Read more

Internet Explorer will download CSS files twice, if referenced via scheme-less URLs

Arne Hartherz
October 30, 2012Software engineer at makandra GmbH

You can use scheme-less URLs (or protocol-relative URLs Show archive.org snapshot ) to have browsers use the current protocol (HTTP or HTTPS) when loading content referenced with such an URL.

A protocol relative URL doesn’t contain a protocol. For example, http://stevesouders.com/images/book-84x110.jpg becomes //stevesouders.com/images/book-84x110.jpg

Browsers substitute the protocol of the page itself for the resource’s missing protocol. Problem solved!

Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

But:

Internet Explorer 7 & 8 will download stylesheets twice if the http(s) protocol is missing.

So if you are working on a publicly accessible site, you can't use it for your stylesheet tags. Everything else works, though.

Posted by Arne Hartherz to makandra dev (2012-10-30 08:39)