react-pdf
react-pdf copied to clipboard
How to disable image caching when using react-pdf
Before you start - checklist
- [x] I have read documentation in README
- [x] I have checked sample and test suites to see real life basic implementation
- [x] I have checked if this question is not already asked
What are you trying to achieve? Please describe.
I'm trying to make sure whenever someone goes to view their documents, their images aren't cached for security reasons. Is there a simple way to achieve this using react-pdf, or do I need to fiddle around with the endpoints that contain images and/or use some sort of cache policy.
Describe solutions you've tried
Describe solutions you've already tried, if any. Make sure to include code samples if you're stuck on implementation.
none. Not sure how to not cache these files. Additional information
If applicable, add screenshots (preferably with browser console open) and files you have an issue with to help explain your problem.
Environment
- React-PDF version [e.g. 4.0.0]:
- React version [e.g. 16.6.0]:
- Webpack version (if applicable) [e.g. 4.27.0]:
Hey there, I believe that the browser may cache PDF files which are downloaded by the browser, but the images and other data extracted should be gone as soon as you close the tab with React-PDF. There wouldn't be an easy way for PDF.js to even cache that. So I'd assume that you should be fiddling around with HTTP headers regarding cache invalidation of PDF files.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
Can we add no-cache while fetching a pdf document?
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
This issue was closed because it has been stalled for 14 days with no activity.