CodeIgniter Forums

Full Version: Delete only special db cache
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi
I use $this->db->cache_on() and it is working well
I cache for each query
But when i try to delete cache,it delete all cache for current segment
Example for /index.php/api/users
I need delete query "Select * from tbl where id = 1" only no all query in segment api/users
Is it possible? or use output->cache for cache?
Who is helping me?
(05-06-2018, 11:49 PM)omid_student Wrote: [ -> ]Who is helping me?

No one with that attitude... there are 36 views, but apparently no one knows the answer. You wan't everyone to type "I don't know"?
(05-07-2018, 12:42 AM)jreklund Wrote: [ -> ]
(05-06-2018, 11:49 PM)omid_student Wrote: [ -> ]Who is helping me?

No one with that attitude... there are 36 views, but apparently no one knows the answer. You wan't everyone to type "I don't know"?

Thanks
From what I read each query is placed in a file and sub-directories.

Read this part.

Database Caching Class
(05-07-2018, 03:57 AM)InsiteFX Wrote: [ -> ]From what I read each query is placed in a file and sub-directories.

Read this part.

Database Caching Class

Yes i know but codeigniter cache each query in single directory and i have to remove all cache for a special query
(05-06-2018, 09:13 AM)omid_student Wrote: [ -> ]Hi
I use $this->db->cache_on() and it is working well
I cache for each query
But when i try to delete cache,it delete all cache for current segment
Example for /index.php/api/users
I need delete query "Select * from tbl where id = 1" only no all query in segment api/users
Is it possible? or use output->cache for cache?

$this->cache->delete('NAME OF YOUR CACHE');
(05-07-2018, 08:35 AM)BobM Wrote: [ -> ]
(05-06-2018, 09:13 AM)omid_student Wrote: [ -> ]Hi
I use $this->db->cache_on() and it is working well
I cache for each query
But when i try to delete cache,it delete all cache for current segment
Example for /index.php/api/users
I need delete query "Select * from tbl where id = 1" only no all query in segment api/users
Is it possible? or use output->cache for cache?

$this->cache->delete('NAME OF YOUR CACHE');
Yes i know but it delete directory according of segment uri,isn't it?
I finally found solution
I try get query of cache that already i save it and md5 it and delete from folder
Example when i cache query "SELECT * FROM users WHERE ID = 1" ,codeigniter make file with b0ef4c88552b8d0d00d22b5425c92aef name in current segment
So i make again same query and md5 it and delete file and recache query
How is my solution?
If it works for you leave it alone.
Pages: 1 2