title: Prefetching $templateCache
body: <p>My angularjs application basically loads in 4 steps:</p>
  <ul>
  <li>main HTML</li>
  <li>all scripts and CSS files</li>
  <li><code>$templateCache</code>, let's call it <code>template.html</code></li>
  <li>images</li>
  </ul>
  <p>I guess, I should bypass the <code>$templateCache</code> when loading the starting page. But for now, I'd like to start fetching <code>template.html</code> ASAP, i.e., at the same time as the scripts get loaded.</p>
  <p>The possibly relevant piece of my code looks like</p>
  <pre><code>&lt;script src='//ajax.googleapis.com/.../angular.min.js'&gt;&lt;/script&gt;
  &lt;script src='/my.js'&gt;&lt;/script&gt;
  &lt;link href='/my.css' media='all' rel='stylesheet'/&gt;
  </code></pre>
  <p>Here, <code>my.js</code> contains all my scripts and gets loaded at the same time as angular. Is there something allowing me to fetch <code>template.html</code> in the same way, so it gets put into the browser's cache?</p>
  <h2>Update</h2>
  <p>I've tried two prefetching possibilities, both failed:</p>
  <pre><code>&lt;link href=&quot;template.html&quot; rel=&quot;prefetch&quot;/&gt;
  </code></pre>
  <p>and</p>
  <pre><code>&lt;iframe class=invisible src=&quot;template.html&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <p>The first gets cancelled and the second comes too late to be effective.</p>