: Why doesn't Firefox cache my images and CSS I am using IIS7, I have already set up the following. But when I run Firefox it seems not to cache any of my images even with "remember history"
I am using IIS7, I have already set up the following. But when I run Firefox it seems not to cache any of my images even with "remember history" set.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
However when I use Firebug it still points to Firefox not caching images and CSS:
public,max-age=604800
Content-Type text/css
Content-Encoding gzip
Last-Modified Mon, 27 Jun 2011 03:53:22 GMT
Accept-Ranges bytes
Etag "507968c27d34cc1:0"
Vary Accept-Encoding
Server Microsoft-IIS/7.5
X-Powered-By ASP.NET
Date Mon, 27 Jun 2011 13:06:41 GMT
Content-Length 5067
Request Headersview source
Host xx.com User-Agent Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept text/css,*/*;q=0.1
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer www.xx.com/ Cookie __utma=62996397.135679654.1309106351.1309159743.1309164158.8; __utmz=62996397.1309106351.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=62996397
More posts by @Kaufman445
3 Comments
Sorted by latest first Latest Oldest Best
What is the request URI for the CSS file? Firefox will not cache the result when the URI contains a query string (i.e. a ? followed by parameters).
According to the HTTP specifications, a browser should never cache a response from a request containing a query string unless the server explicitly allows it. Unfortunately though, Firefox and IE do not comply to this rule. IE does cache it regardless of a query string but Firefox never caches it regardless of any cache control headers.
Have you enabled static content compression in IIS?
Apparently (according to this question: stackoverflow.com/questions/6420995/iis-7-x-static-compression-not-frequently-hit) IIS may decide not to compress files if they are RARELY accessed. I have not had ANY issues with this point -- even freshly created file worked fine.
Use bigger max-age value -- 30 days or more (although it should not affect caching THAT much to completely prevent file from being cached).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.