Delete only special db cache |
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?
From what I read each query is placed in a file and sub-directories.
Read this part. Database Caching Class What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-07-2018, 03:57 AM)InsiteFX Wrote: From what I read each query is placed in a file and sub-directories. 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 $this->cache->delete('NAME OF YOUR CACHE');
(05-07-2018, 08:35 AM)BobM Wrote:Yes i know but it delete directory according of segment uri,isn't it?(05-06-2018, 09:13 AM)omid_student Wrote: Hi
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.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |