title: Caching across protocol by using //:domain.com - is it possible?
body: <p>I believe the recommended way these days is to serve static files from a domain using //domain.com rather then <a href="http://domain.com" rel="nofollow">http://domain.com</a> and <a href="https://domain.com" rel="nofollow">https://domain.com</a> as needed. In fact <a href="https://developers.google.com/speed/libraries/devguide" rel="nofollow">https://developers.google.com/speed/libraries/devguide</a> lists snippets in this format.</p>
  
  <p>My question is, does this or any method allow caching across http/https? I thought it did (can't remember why) but my testing doesn't seem to allow me to do it. The problem is I recently changed a number of things about my setup (server, PHP framework) and so can't be sure why I cant cache across http/https (unless of course it isn't possible).</p>
  
  <p>I'm wondering which of the methods is best to include static files:</p>
  
  <p>(1) Serve exactly http or https depending on the page requested</p>
  
  <p>(2) use //domain.com</p>
  
  <p>(3) Always use https to serve static content, even on http pages as that way it will only donwnload once, but of course first visit to a site uses https for static content which can be slow, but at least it won't download files twice.</p>
  
  <p>I know there's an issue in IE7 and 8 with stylesheets by using the //domain.com method though.</p>
  
  <p>Any help, and particularly is it possible to cache across protocol as when a user first uses a https page for the first time it's really slow (until everything's cached) and I want to stop that.</p>