javascript - Clear browser cache with query string approach -


i need clear browser cache when push updated javascript file on server. simple answer use below technique of query string.

<script type="text/javascript" src="/js/myjsfile.js?{my file version}"></script> 

it work

  1. do need on every single script tag of every single page of application?
  2. can @ main screen login loads @ beginning , assume clear cached file new one, work?

"do need on every single script tag of every single page of application?"

yes do. cache based on file's url, including parameters.
adding parameters doesn't remove file browser's cache, more or less sees new, different file.

this answers point 2, since having on pages means can't on 1 page.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -