Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not positive that no-cache <code>meta</code> tag is the way to go. It negates <strong>all</strong> caching and kind defeats the purpose of quickly accessible pages.</p> <p>Also, AFAIK, <code>meta</code> tag works per page, so if you have a page without it that references your JS - it will be cached.</p> <p>The widely acceptable way of preventing JS files (and, again, CSS) from being cached is to differentiate the requests for them:</p> <p>Say, you have:</p> <pre><code>&lt;script type=”text/JavaScript” src=”somescript.js″&gt;&lt;/script&gt; </code></pre> <p>this one will cache it (unless the above meta-tag is present.</p> <p>What you want to have is that on each page load the above line looks different (URL-wise) like so:</p> <pre><code>&lt;script type=”text/JavaScript” src=”somescript.js?some-randomly-generated-string″&gt;&lt;/script&gt; </code></pre> <p>Same goes for CSS.</p> <p>If you were using some sort of JS network - it would take care of that for you had you given it some sort of "no-cache" configuration option.</p> <p>You, of course, can do it in pure JS too. Some sort of <code>Date</code> related string is an option.</p> <hr> <p>Now, normally, you would not want to negate all the caching, so the way to do so is to add a version parameter to your URL:</p> <pre><code>&lt;script type=”text/JavaScript” src=”somescript.js?version=1.0.0″&gt;&lt;/script&gt; </code></pre> <p>and manage your scripts from there.</p> <p><strong>EDIT</strong></p> <p>There is no need for any additional extension. Unless I am sorely mistaken, "Chrome Developer Tools" is built in in all Chrome versions (in beta and dev, for sure) and is accessible by pressing <strong>Ctrl-Shift-I</strong>. There, in "Network" tab, you can see all your requests, there content and headers.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload