WebFaction
Community site: login faq

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,

  • Andrew

asked 10 Aug '11, 18:22

adsgray
122
accept rate: 0%


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?

permanent link

answered 10 Aug '11, 19:24

johns
5.3k312
accept rate: 23%

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.

permanent link

answered 12 Aug '11, 17:07

adsgray
122
accept rate: 0%

Thank you for sharing your result with the community.

(12 Aug '11, 17:50) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×186
×28
×1

question asked: 10 Aug '11, 18:22

question was seen: 5,091 times

last updated: 12 Aug '11, 17:50

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM