Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a webpage which has a link to a PDF file. Every time I update the PDF file, Internet Explorer will not load the updated file; it keeps showing the old file, even if I refresh the page. At this time, the only way it will show the updated file is for me to change the file name (of the PDF file), but that is troublesome since I update this PDF file often.

Does anyone know what to do?

share|improve this question
    
You could try changing your URL to foo.pdf?revDate=20130916 –  dcaswell Sep 16 '13 at 14:15
    
@dcaswell, you mean add foo.pdf?.... At the end of the URL containing the file? Can you be more specific? thank you. –  user31266 Oct 7 '13 at 23:16

3 Answers 3

up vote 2 down vote accepted

If you change the parameter on the end of a URL, browsers will "know" not to cache the result.

Rather than change the name of the PDF you can just add a parameter onto the end of the URL that references it.

First: foo.pdf?revDate=20130916 and then foo.pdf?revDate=20131007 etc.

share|improve this answer
    
Thank you. It works!! –  user31266 Nov 30 '13 at 23:06

If you've got some kind of control over said site you should indicate the file is not to be cached by stating so in the headers. The basic headers (in pseudo, for HTML/1.1) you'd need would be:

Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Expires: {current_time}

For more info on the first two headers look at RFC2616 14.32 Pragma and 14.9 Cache-Control. Info on the Expires header as well as the format of the time with which to replace {current_time} can be found in chapter 14.21 Expires of that same specification.

FYI: Setting these headers will - of course - not force an already cached file (in your case: a previously viewed one) to be reloaded without you forcing it to do so (e.g. by emptying your cache).

share|improve this answer

Internet Explorer has already downloaded the file, so telling it to download it again only results in opening the file already downloaded. You can check where Internet Explorer is downloading the file to and delete it before downloading and opening a new version of the file.

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.