Hi, I'm hosting a cakePHP application (PHP 5.2) on webfaction. I have some static files in app/webroot, specifically app/webroot/css/style.css, and after I update them my browser will continue to use its cached version. I assume that my browser is getting a 304 not modified response for the resource, either from apache or an nginx cacheing server that's sitting in front. Is there a way for me to invalidate the cache for these files so that when I deploy new versions they'll be served immediately? Thanks,
asked 10 Aug '11, 18:22 adsgray |
We do not have any caching in place to render a 304. You should try the URL in wget to be 100% sure. Could you provide the full URL so we can take a look? answered 10 Aug '11, 19:24 johns Hmmm, now I'm not sure what's going on. I used curl to fetch my css file, modified it, then did curl -z savedfile.css http://... and it fetched the modified file. So there doesn't appear to be anything between me and the app being naughty. Thanks!
(10 Aug '11, 23:02)
adsgray
You're welcome.
(10 Aug '11, 23:19)
johns
|
Hi, To answer my own question specifically: The cakePHP application is clever and bundles all of my CSS assets into one big file and stores it with a name like large_hex_string.css. My pages reference this file in their HEAD sections, not the individual style.css files. Now, the cakePHP app must have been setting ungodly long cache times on these files. If I manually remove the generated css files they are regenerated again from the sources and all is well. answered 12 Aug '11, 17:07 adsgray Thank you for sharing your result with the community.
(12 Aug '11, 17:50)
johns
|