Saturday, July 27, 2013

Re: Cache Help

I must admit, I've never cached model data. I figure the database engine will be better at caching data for quick (and often) retrieval in its buffers.  But I have done caching of results of web services, and the occasional view.

If you had to do caching of model data, then I would recommend clearing the relevant caches in the afterSave() and afterDelete() methods.  And even then, you should only need to clear the entry for the specific cached record.  You just need to make sure you an reproduce the key that you're using to save the data from the afterSave and afterDelete locations.

Regards
Reuben Helms

On Saturday, 27 July 2013 10:05:30 UTC+10, advantage+ wrote:

Maybe I was reading wrong but I was under the impression if you cache an object (find data) if it was different it would delete the original cached data.

 

I am caching the results of a find, but as admin if I edit the record the cached data is always returned not the new data.

 

Is ther a way to fetch new data after save and delete cached info?

 

Dave Maharaj

Freelance Designer | Developer
Description: header_logo

www.movepixels.com  |  dave@movepixels.com  |  709.800.0852

 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: