简体   繁体   中英

PDF does not reload on directory browsing

Hi guys this is my follow up question and I think this is the real issue here. Click Here

Whenever I access the file using the directory browsing (eg. http://localhost/temp/1.pdf ) it always render the old or previous PDF file even if I change the entire file with the same file name, example I have 1.pdf with some content then I delete this file on the directory then replace with new and different content and rename it to 1.pdf then when I access it using browser it always render the previous value not the new one that I replace. This only happens on IE and Opera browser. Please need help this is a production issue.

Edit: I found something very strange, example i have this url for the location of the pdf file (eg. http://localhost/website/tempfolder/1.pdf ) the first pdf that I generated will show then some part in my code I change the casing of some letter example 't', I change it to 'T' then the newly pdf shows but when I revert back to the old case expecting that it will show the new pdf but sad to say the first PDF file shows.

Your browser is probably caching the PDF files.

For IE, you can do a CTRL F5 to force it to reload from web server. Or put a random query string in your URL eg /temp/1.pdf?v=1, /temp/1.pdf?v=2

Assuming you server is IIS, permanent solution is to configure HTTP response headers.

Go to IIS manager

Navigate to your folder

Click "HTTP Response Headers" in Features View

Right-button click/select "Set Common Headers"

Check "Expire Web Content" and select "Immediately".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM