0

I think that I configured caching correctly for my domain but still both Fiddler and Firefox webdeveloper show me that all images, css and js are loaded on every request.

This is the response header for one of my images:

Server  nginx/0.8.36
Date    Sat, 30 Apr 2011 05:02:58 GMT
Content-Type    image/jpeg
Connction   keep-alive
Last-Modified   Fri, 08 Apr 2011 22:11:34 GMT
Etag    "16456ec39f6cb1:0"
X-Powered-By    ASP.NET
MicrosoftOfficeWebServer    5.0_Pub
MS-Author-Via   MS-FP/4.0
Content-Length  2885
Expires Tue, 24 Apr 2012 05:02:58 GMT
Cache-Control   max-age=31104000
X-Cache HIT
Accept-Ranges   bytes

So, I have the Expires header item and Cache-Control has a max-age value (should be one year). If you're wondering: the files are originally served from ASP.NET but there is a CDN in between which is adding some header items.

Where is my mistake???

The request ist just like "http://images.mydomain.com/filename.jpg". There are no unique querystring parameters attached.

newtogit
  • 553
  • 1
  • 8
  • 11

3 Answers3

0

Try to add

Cache-Control: public, max-age=31104000

You can find more about Cache-Control here.
You can find some more information here.

Community
  • 1
  • 1
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
0

OK, it just seems that I am not able to use Fiddler very well. I downloaded Chrome to test my web site and the developer tools of Chrome tell me that my files ARE coming from the cache. That's what I would have expected with the above headers.

The open question for me remains why Fiddler is showing the requests if they are coming from the cache. Perhaps I'll post that as a separate question :)

newtogit
  • 553
  • 1
  • 8
  • 11
-1

Looks like Expires date set to the past.

Timofey Stolbov
  • 4,501
  • 3
  • 40
  • 45