• Hi,
    Our site has a lot of forms (mainly PDFs) that get updated fairly regularly by various users. I’ve noticed that PDFs are in the Media and Other Files section in Performance->Browser Cache, and the default max-age is a week. I’d like to be able to set a shorter max-age for PDFs only (the other media files should stay cached for 7 days)

    I tried setting the Cache Control Policy to ‘Cache with max-age and validation’ for Media and Other Files, but it the client still got the old versions after I changed some PDFs (the client had downloaded the PDFs prior to the changes).

    So far the only way I’ve found is to set .htaccess to read-only and then manually change the max-age for PDFs. I can live with that, but it would be great if there was an option to add an exclusion for specific file types in Browser Cache (i.e., those file types would get a max-age of 0 or something much smaller than the others in the same category), kind of like the ‘Never cache the following pages’ option in Page Cache.

    I’ve been testing a development version of our site with W3TC managing Varnish 4, and so far it’s been great. This is quite a plugin! BTW, I do have Varnish set to pass PDFs, so that shouldn’t be causing problems:

    if (req.url ~ "\.(pdf|doc|docx)") {
      return (pass);
    }

    Thanks so much for your help!

    Matt

    https://www.ads-software.com/plugins/w3-total-cache/

  • The topic ‘PDFs and browser caching’ is closed to new replies.