react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

How to disable image caching when using react-pdf

Open FriendlyUser opened this issue 5 years ago • 3 comments

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]:

FriendlyUser avatar Jan 24 '19 00:01 FriendlyUser

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.

wojtekmaj avatar Jan 28 '19 15:01 wojtekmaj

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.

github-actions[bot] avatar Jun 06 '22 00:06 github-actions[bot]

Can we add no-cache while fetching a pdf document?

ravishan110 avatar Jun 23 '22 16:06 ravishan110

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.

github-actions[bot] avatar Sep 26 '22 00:09 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Oct 10 '22 00:10 github-actions[bot]