0

Here we are using Pdf.js extension and Ifram in application, but we are facing issue with browser cache, its storing in browser but the physical files getting changed by service, and after file content change also its showing previous document details, its not refreshing.

Please provide a solutions to clear cache (Text of webpages you've visited in Google Chrome is removed from your computer. Browsers store elements of webpages to speed up the loading of the webpage during your next visit. — Source) in in Javascript / JQuery or AngularJS

tried with app.js?123 and <meta http-equiv="Cache-Control" content="no-cache, no-storeenter code here, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="0">

but not working....???

1 Answers1

1

Versioning the Javascript file is one of the options to force browser to get the updated content of the file. For example:

pdf_v001.js
pdf_v002.js
pdf.js?v=001
pdf.js?v=002

If you have a version control system, you could inject the version number something like this:

<script type="text/javascript" src="pdf_$$REVISION$$.js"></script>

or:

<script type="text/javascript" src="pdf.js?v=$$REVISION$$"></script>

Please refer to this link: How can I force clients to refresh JavaScript files?

Peter Sun
  • 11
  • 2