Static File Caching at Server Side

J

Jerad Rose

I have been struggling with this for years, and have recently become
determined to find a solution for this. If anyone has *any* ideas about
this, please offer your suggestions.

Basically, I am having problems with static files -- specifically CSS -- not
being instantly updated when changes are made. For example, I am working on
a CSS file for my site, so I am making some trial-and-error changes,
applying them and then refreshing the page to see the results. But the
problem is, unless I wait X amount of time between requests (it seems to be
TTL of about 30 seconds), the old version still pulls up. I can even go to
a new computer that has never visited the site after immediately making
changes, and it still pulls up the old version.

I have read various articles and newsgroup postings regarding this. Some
suggest disabling memory cache or shortening the object cache ttl. First of
all, this is not an option -- I want static files cached, I just want it to
go get the latest version when changes are made, without having to wait 30
seconds between requests. Second, I did try it just to rule that out, and
it didn't seem to have an effect -- though I didn't test too thoroughly as
this was a production box, and I didn't want it hitting the HD that much for
static files (and that setting is, unfortunately, an OS-level setting).

I have also tried enabling content expiration on this particular CSS file,
but that had zero effect. I also tried adding "no cache" content headers
(Cache-Control: private, no-cache, must-revalidate) for this file, but this
also had zero effect. I did verify that the CSS is not being cached locally
now (my Temporary Files folder never has the CSS file after this content
header is added) -- but it is still pulling the old version if I request
within 30 seconds of the last request.

This also is not an issue of proxy caching, as there are no proxy servers
between the server and client.

The thing is, I have had this same exact problem on *several* sites over the
years -- both ASP sites and ASP.NET sites. I believe my sites have always
run on IIS 5.0 (Windows 2000).

I don't understand why IIS would be configured so that it would completely
ignore the fact that a static file has a new version, and still serve up the
old version.

If you need any additional info, let me know. If I need to try another
group, let me know. The reason I posted to this one, is because the most
helpful thread I've seen on this subject was in this group:

http://groups.google.com/group/micr....aspnet/browse_thread/thread/7159555c655d1d44

Thanks in advance for any light you can shed on this mystery.

Jerad
 
J

Jerad Rose

I have moved this topic to this newsgroup: microsoft.public.inetserver.iis

Please make any responses you may have there.

Thanks.
Jerad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top