#1 February 11, 2015 1:42pm

jesse.glaves
Member
Registered: June 28, 2014
Posts: 124

File Caching On Overwritten Documents

Any advice on how to deal with the browser caching of documents such as PDF's when you overwrite them with the "replace" option in the file manager? If the user doesn't force refresh the browser, it still appears as the older content.

Offline

#2 February 11, 2015 2:19pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: File Caching On Overwritten Documents

I'd recommend setting custom no-cache headers for PDFs in /site/.htaccess -- since that content probably isn't loaded very frequently it shouldn't need to be cached at all. You could do something like this to make the file (hopefully) un-cache from the user's browser after 5 minutes:

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType application/pdf "access plus 5 minutes"
</IfModule>

Offline

#3 February 12, 2015 3:24pm

jesse.glaves
Member
Registered: June 28, 2014
Posts: 124

Re: File Caching On Overwritten Documents

Thanks Tim. That sounds perfect. I implemented it, and will test it out.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.