How to disable caching for a downloadable file

https://digital-wings.netlify.app/
https://www.digitalwings.nz/

Hi, this site has a couple of registration form as downloadable PDF’s but when the form is changed some visitors report getting the old version. I assume this is due the PDF’s getting cached along with the rest of the site. Is there a way to exclude just the PDF files from being cached? Cheers…

hmm, i am not a super expert in this area, but, i do believe that if all the PDF files live in a specific directory, you can set specific caching rules (in this case, to not cache) for those files.

give this a read through and see if it is helpful:

Thanks Perry, I’ll have a read and let you know how I get on. Cheers, David

1 Like

Hi Perry,

I created a _headers file with the following and it’s working a treat.

/documents
cache-control: max-age=0,no-cache,no-store,must-revalidate

Thanks for your help
David

Thanks for this.
In case someone is using Build Hooks, you can tell to clear all cache:

1 Like

Thanks for sharing this with the community @eko