title: Host Typekit JS Locally
body: <p>Typekit requires us to include their JS file to render the fonts, e.g.:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://use.typekit.com/random-name.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;try{Typekit.load();}catch(e){}&lt;/script&gt;
  </code></pre>
  
  <p>I have noticed there has been a few instances where their server is slow to response, which caused the page to halt. Unfortunately, some people have had similar experience.</p>
  
  <p>I tried to host the JS file locally and it seemed to work.</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://use.typekit.com/random-name.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;window.Typekit || document.write('&lt;script type="text/javascript" src="/scripts/js/ext/random-name.js"&gt;\x3C/script&gt;')&lt;/script&gt;
  &lt;script type="text/javascript"&gt;try{Typekit.load();}catch(e){}&lt;/script&gt;
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li>Any differences when rendering the fonts from a local JS?</li>
  <li>Will the <a href="http://blog.typekit.com/2009/07/21/serving-and-protecting-fonts-on-the-web/" rel="nofollow noreferrer">HTTP referrer</a> be the same between using a remote JS and a local one?</li>
  </ol>
  
  <p>Thank you.</p>
  
  <p>Related:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/10797262/583539">Loading script asynchronously</a></li>
  <li><a href="http://www.webmonkey.com/2011/05/stop-typekit-fonts-from-slowing-down-your-site/" rel="nofollow noreferrer">Stop Typekit Fonts From Slowing Down Your Site</a> </li>
  </ul>