Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a debian webserver running apache, from which I regularly download an executable using IE 8 on an XP virtual machine (over LAN). However, I realised that somewhere along the line that I've been repeatedly running the same version (and wondering why my changes weren't being displayed).

A Ctrl+F5 in IE will let me download the new version (although the page is always updated with a simple F5).

This makes me suspect that the caching is happening in windows/IE, but I'm not certain.

Wherever it's happening, is there an easy way to prevent it at the server? Eventually, we're hoping to offer the software to the entire company, and we'd like to avoid having to tell everyone to do a Ctrl+F5 every time there's an updated version.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

If you believe Apache is caching the file, you can turn it off using .httaccess directives:

<FilesMatch ".(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</FilesMatch>

This directive should tell IE to download the page every time it hits the site.

Alternatively, you can tell IE 8 to never cache a web site - go to: Tools, Internet Options, General Tab, Temporary Internet options.

Recognize that there may be a a performance hit due to this setting either on your web server, or at the client side. May not be an issue based on your description.

share|improve this answer
    
The page is fine, it's the executable that's being cached erroneously. –  RoadieRich Jul 1 '13 at 16:37
    
Ok, yours wasn't exactly the right solution, but it pointed me towards the right mods - the only change needed was to replace ".(html|htm|js|css)$" in the <filesMatch> with ".exe$". –  RoadieRich Jul 1 '13 at 16:51

You can set the webpage to not cache - that way the browser will always get the latest file. Set this in the HTML header of the page:

<meta http-equiv="Cache-Control" content="no-store"/>

You can also set what the cache control headers send in Apache - for instance, you may need to set it for .exe files instead of just the html page. Here's some documentation on that: http://www.askapache.com/htaccess/apache-speed-cache-control.html

Another option is to use "cache busting URLs", even though this doesn't sound like it'd apply in your current setup. It is something to be aware of though: http://www.adopsinsider.com/ad-ops-basics/what-is-a-cache-buster-and-how-does-it-work/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.