title: Expires and CDNS - YSlow Problems
body: <p><em>Let me first mention that I have done some digging but can't seem to find a proper answer to what I'll looking for.</em></p>
  
  <p>I'm working on a site where I am using a few external resources:</p>
  
  <ul>
  <li>Google Analytics (//www.google-analytics.com/analytics.js)</li>
  <li>Latest jQuery version (<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js</a>)</li>
  <li>Google Fonts (<a href="http://fonts.googleapis.com/css?family=Lato:400,300" rel="nofollow noreferrer">http://fonts.googleapis.com/css?family=Lato:400,300</a>)</li>
  </ul>
  
  <h3>Use a Content Delivery Network (CDN)</h3>
  
  <p>I'm getting an "F" grade on "Use a Content Delivery Network (CDN)". A different <a href="https://stackoverflow.com/questions/7030252/yslow-what-does-clicking-add-cdn-do">SO Post</a> links to the YSlow FAQ (<a href="http://yslow.org/faq/#faq_cdn" rel="nofollow noreferrer">direct link</a>) but this seems to indicate that I need to define my CDN's on my browser, which seems to be a quick fix for me, but this does not solve the problem on other browsers and/or devices.</p>
  
  <h3>Add Expires headers</h3>
  
  <p>As for the "Add Expires headers" grade,I get an E. Problem is, this is what I'm getting:</p>
  
  <pre><code>There are 3 static components without a far-future expiration date.
  
  (2014/2/26) http://fonts.googleapis.com/css?...
  (2014/2/26) http://www.google-analytics.com/analytics.js
  (2014/2/26) http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js
  </code></pre>
  
  <p>How would I go in order to correct this? My local files are all taken care of by my <code>.htaccess</code> as shown, here:</p>
  
  <pre><code>AddType image/x-icon .ico
  
  ExpiresActive On
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType text/x-javascript "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresByType image/ico "access plus 1 year"
  ExpiresDefault "access plus 7 days"
  
  &lt;FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$"&gt;
      # access plus 1 year
      Header set Cache-Control "max-age=31536000"
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>This <a href="https://stackoverflow.com/questions/1439042/how-can-i-add-expire-headers-for-scripts-that-are-not-on-my-server">SO post</a> seems to suggest it is either impossible, or I call upon a local script where I use my bandwidth to load (and cache) the required external files.</p>
  
  <p>So, with these things in mind, here is what I'm looking at:</p>
  
  <ol>
  <li>External ressources should be CDN's, but YSlow reads my local preferences which will vary from user to user, so I need an alternative to the <code>about:config</code> solution proposed by the YSlow official site.</li>
  <li>Expires are set by the server where the file is, so I don't seem to have access to defining it's expiration values. So, from what I gather, I could carry these files onto my server <em>or</em> use a local PHP file and cache it from said PHP file located my server, but this doesn't seem optimal. Is there a way to go around this?</li>
  </ol>