Mobile app version of vmapp.org
Login or Join
Kaufman445

: 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"

@Kaufman445

Posted in: #Iis #Iis7

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

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

3 Comments

Sorted by latest first Latest Oldest Best

 

@Shakeerah822

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.

10% popularity Vote Up Vote Down


 

@Sims2060225

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).

10% popularity Vote Up Vote Down


 

@Kevin317

Remove the etag header
Use the Cache-Control header to have a large max-age value
Set the Expires header to be a far future date


I am unsure how to do this with IIS but if you do the above Firefox should cache your images and any other files you wish to have cached.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme