Show me the Cache
I’ve been doing a lot of work for one of my clients recently, which has involved overhauling a lot of the data models that are used on the site. A few weeks ago, while I was doing this, I finished testing and was ready to deploy to production. I follow the process I was aware of and none of the changes I had made were appearing. This was obviously very concerning. Cue the hours of searching for something wrong with your code, double-checking every last bit, testing again in UAT, etc., etc., AND NOTHING WORKS.
Then it hits you. The cache.
Now, granted, it would seem that the official documentation for deploying updates for the framework I am working in for this project (CakePHP 4) does say to run a command to clear the cache each time you make a deployment, but at the same time if I know what is needed to be done to migrate my changes into the database, why isn’t the cache cleared automatically when the migration occurs? Is there an opernational reason for this behavior?
Also, the cache refresh period on a production run of CakePHP 4 is really long (365 days according to the docs) without any seeming way to reduce it. This also almost tripped me up when I was doing some i18n work on the, a post for another time.
Anyway, if you’re running into issues between prod and loiwer environments after testing is complete, the cache is a great place to look if it is causing your issues.