Rob--W / pdf.js

PDF Reader in JavaScript
Apache License 2.0
5 stars 3 forks source link

pdf.js uses cached pdf even with "Force Reload" #7

Closed zsiegel92 closed 5 years ago

zsiegel92 commented 5 years ago

Configuration: Mac, Chrome 70.0.3538.110 (Official Build) (64-bit), browser extension, PDF Viewer 2.0.673

Steps to reproduce the problem:

  1. Open a pdf from a (non-local file) URL
  2. Make changes to that pdf, upload to remote URL (eg to GitHub Pages)
  3. "Force Reload" the browser
  4. Changes are not observed in browser.

What is the expected behavior? (add screenshot) Changes to pdf should be seen in browser.

What went wrong? (add screenshot) Browser used the cached pdf, even with a "Force Reload". When "Developer Tools" is open, the "Force Reload" successfully ignores the cache when "Disable cache (while DevTools is open)" is checked (in "Network" tab of DevTools). A "Force Reload" should ignore the cache even without DevTools open. The Chrome native PDF viewer does not have this issue.

Rob--W commented 5 years ago

Thanks for this bug report. I am aware of the issue, but never got around to filing an actual bug report. I don't see a way to fix this through the webRequest API, nor Service Workers, because the extension page request always uses Cache-Control: no-cache. The best I can do is to detect whether Ctrl-F5/Shift-F5 is used (within the PDF viewer) and then (reload) the PDF.

Please file bugs in the main repository at https://github.com/mozilla/pdf.js/issues