Delete Cached Models in CakePHP

September 15th, 2009 by Harisenbon Leave a reply »

Did you know that CakePHP automatically caches a lot of your data so that you don’t have to call (for example) model references over and over again? Isn’t that nice?

Did you know that if you make a change to your database (for example: adding a column) and the caches haven’t been updated, it will neither SAVE nor RETRIEVE any data relating to those changes?

Did you know that cake won’t tell you that your models might be out of date, and that you can easily waste 2-3 HOURS of your life on something stupid like that?

Do yourself a favor: When you change your database, delete EVERYTHING in app\tmp\cache\models

And thankyou for the heads up, Snook.ca

Advertisement

Leave a Reply