title: How does caching in the case of dynamic files/urls work?
body: <p>Can someone please clarify how caching works ? Or does it entirely depend on the browser ? </p>
  
  <pre><code>&lt;script type="text/script" src="/controller/getfoo"&gt; &lt;/script&gt; 
  </code></pre>
  
  <p>is a dynamic way of serving js file where request is set as a js file from controller .</p>
  
  <pre><code>&lt;script type="text/script" src="/somewhere/foo.js"&gt; &lt;/script&gt; 
  </code></pre>
  
  <p>is the most normal way of doing it .
  How does the caching work in both cases ? </p>
  
  <p>In case 1 it is going to sent a HTTP request all the time ? However that is during the page load only . In case 2  browser understands the file name is mentioned explicitly and it will check if foo.js is already available locally else sents a HTTP request ? </p>