• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete only special db cache

#1
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?
Reply

#2
Who is helping me?
Reply

#3
(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"?
Reply

#4
(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
Reply

#5
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 )
Reply

#6
(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
Reply

#7
(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');
Reply

#8
(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?
Reply

#9
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?
Reply

#10
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 )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.