Jump to content

Headers set correctly but not properly caching files (not return 304's)


coda

Recommended Posts

Hi all,

 

I have a slight problem with a local application I'm currently running some tests on. Basically I have a simple php page which is only serving:

 

  • A dynamic CSS file
  • An image
  • Static text

 

I have set the headers (which I believe to be correct) for the CSS file, however Firebug reports the content as not being cached (returning a 200 instead of a 304). Along with this, the page itself returns this - 1.2 KB (435 B from cache), meaning that only the image (435 B) is actually being read from the cache and not the HTML page or CSS file.

 

I've tried many variations to the header without success. Also, one thing to note is the image expires is being set through Apache and not PHP like so:

 

ExpiresActive On

<FilesMatch "\.(php|gif|jpg|jpeg|png|swf)$">
ExpiresDefault "access plus 1 month"
Header append Cache-Control "public"
</FilesMatch>

 

Am I completely missing something from here? I have even done this for the PHP page but even that returns a 200 instead of a 304 - which is what it should return.

 

Any insight would be much appreciated on this.

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.