Pdf nocache




















Posting the solution for others for future reference. Note: This solution assumes your MediaWiki installation is running on Apache. Navigate to your httpd. Underneath the " LoadModule" lines, add the following;. The server tells the browser to check for the latest versions of css, htm, gif, jpg, jpeg, js, png and pdf files.

You can edit this list to your hearts content. If the version on the server is different than the one the browser has in its cache, the browser will download a new copy and refresh its cache. Nice to see that you found a solution already. With what you do, basically all files from a folder starting with "i" get this header. This will lead to the same result, but performance-wise it should be cheaper. A very good point, thanks for pointing this out. What about the unfortunate souls that have to use IIS instead of apache?

Edited , 16 July 7 years ago. This post was hidden by You could also change the number only, if the file has changed, for example using the mtime of the file. IE uses its own caching mechanism when reading PDFs inline.

Controlling the cache settings down the pipe is not fool proof. The alternative is to encode the realtime and date in the file name of the PDF. You can encode the time date into the filename of the PDF so that each time a request is made the filename is unique.

How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 11 months ago. Active 9 years, 4 months ago. Viewed 19k times. FireFox and Chorme deals just fine with the following headers and doesn't cache any pdf file: Response.

Improve this question. Niv Niv 71 1 1 gold badge 1 1 silver badge 2 2 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. This is most definately an elegant work-around for this kind of issue. This will not work if pdf on server has spaces in the name. I may go this route too. P4ndaman P4ndaman 2 2 gold badges 7 7 silver badges 21 21 bronze badges.

BZ1 BZ1 1, 2 2 gold badges 8 8 silver badges 10 10 bronze badges. You need to write that code. I thought the reason you did not want the PDF document to be cached was to ensure that a fresh PDF was generated each time. Now, I realize that you want to prevent it from being stored in the client.



0コメント

  • 1000 / 1000