重新生成pdf文件时缓存Internet Explorer的问题 [英] Caching issue with internet explorer when re-generating pdf files
问题描述
你好,
我正在通过浏览器Internet Explorer获得缓存问题。
我的Web应用程序生成pdf文件,我有一个结果页面,其中包含指向这些PDF的链接。
如果我刷新页面,则会删除旧文件并重新生成新文件pdf文件。
但是当我点击使用Internet Explorer的链接时,它会显示旧的pdf文件,该文件不在该路径上。
如果我在不同的浏览器(Firefox,crome,safari)上复制相同的路径,那么它工作正常。
所以,我认为这是缓存问题。如果我关闭浏览器(IE)并重新打开它然后它可以工作。
请告诉我解决这个问题。
谢谢
Advay Pandya
Hello,
I am getting caching issue with the browser "Internet Explorer".
My web application generates pdf files and I have a results page with links to those PDFs.
If I refresh page then it deletes the old file and re-generate the new pdf file.
But when I click on the link using "Internet Explorer" then it shows the old pdf file, this file is not there on that path.
If I copy same path on different browser(Firefox, crome, safari) then it works fine.
So, I think this is caching issue. If I close browser(IE) and re-open it then it works.
Please advise me to fix this issue.
Thanks
Advay Pandya
推荐答案
通过添加包含时间戳的查询字符串来解决此问题。
赞:如果我的文件名是hello.pdf那么我们可以通过以下方式传递
mywebsite / hello.pdf?051320151220000
(pdfname?时间戳)
通过这种方式,浏览器会认为这是一个新鲜的URL。因此它将显示新的pdf而不是缓存的pdf。
如有任何疑问或疑问,请与我们联系。
谢谢
Advay Pandya
The issue is fixed by adding a query string containing time stamp.
Like: If my file name is "hello.pdf" then we can pass in the below way
mywebsite/hello.pdf?051320151220000
(pdfname?time stamp)
by using this way, the browser will think that this is a fresh URL. So it will show the fresh pdf instead of cached pdf.
Please let me know for any concern or query.
Thanks
Advay Pandya
这篇关于重新生成pdf文件时缓存Internet Explorer的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!