We are using the Files API to upload PDFs to attach to notes. Periodically we update the PDF and upload it again (with the overwrite flag set to true).
The upload/overwrite works fine but it seems the original PDF is cached on CDN for some period of time. I tested by:
- Upload PDF Version 1.
- View The PDF via the CDN URL (something like https://cdn2.hubspot.net/hubfs/<some_id>/pdf_1.pdf)
- Upload the modified PDF (with the same name as the original)
- View the PDF at https://cdn2.hubspot.net/hubfs/<some_id>/pdf_1.pdf again and it has not changed (even with browser cache cleared or even viewing it from another browser).
- View the PDF with some random junk on the query_string: https://cdn2.hubspot.net/hubfs/<some_id>/pdf_1.pdf?1111 and I now see the new version of the PDF
How long will the file be cached? Is there anyway to invalidate the cache when we upload a new version of the file?