I am aware that for SSL, and non SSL connections, you can use the // double slash followed by domain name and file src within CSS and JavaScript and HTML. Examples:
<script src="//site.com/js.js"></script>
<img src="//site.com/pic.jpg" />
.div{background:url(//site.com/assets/bg.gif)}
Does this slow down the page – latency – does the browser or mobile device need to check this ever time?
This is fine, and works excellently…. Except in two particular circumstances:
Firstly, in ie 7 & 8, if this approach is used with CSS, two copies are downloaded, one from HTTP one from HTTPS and one from HTTP – so you’re wasting some bandwidth there (though it’s not necessarily a bad thing if you send expires headers down the wire with the CSS)
Finally, if you are using a windows machine this path may trigger a lookup for a network path when working on your local machine – if you have experienced slowness using this approach, this is likely the cause.
Some discussion around this in this article, Paul Irish makes a comment on the article about the second issue i outlined, and someone else discusses the first issue.
Hope that helps.