Performance and RFC 2396
Published on February 18, 2009 (⻠February 5, 2024), filed under Development (RSS feed for all categories).
This and many other posts are also available as a pretty, well-behaved ebook: On Web Development.
RFC 2396 specifies that relative URIs like //foo
get resolved as http://foo
. This means, if you link a resource like https://example.com/
, @href
may as well just point to //example.com/
.
Figure: An image that wouldnât be there if @src
couldnât start with //
.
This has two advantages: You can avoid security alerts when juggling with and switching between http and https, and you can save a couple of characters per URI reference. But Iâm saying that just to inspire performance critics who already and with great joy discussed general advantages of HTML, including omitting optional tags.
Since this part of RFC 2396, seen as a whole, is still relatively new to me feel free to add to this. Iâm just curious and love experimenting. So after I verified that all major browsers support the //
syntax I actually created a âhoneypotâ test page to see whether that page gets indexed properly by search engines. Watch this space for the findings.
Update (February 28, 2009)
As it seems, all major search engines followed the âhiddenâ links to the RFC 2396/3986 test page I set up: Google was first, Yahoo, Microsoftâs Live Search, and Altavista followed over the last days. Thereâs a slim chance that the test might have been compromised, but there are no indicators whatsoever solidifying that concern.
Update (June 28, 2013)
Weâve found this approach so useful, itâs common practice now.
About Me
Iâm Jens (long: Jens Oliver Meiert), and Iâm a frontend engineering leader and tech author/publisher. Iâve worked as a technical lead for companies like Google and as an engineering manager for companies like Miro, Iâm a contributor to several web standards, and I write and review books for OâReilly and Frontend Dogma.
I love trying things, not only in web development (and engineering management), but also in other areas like philosophy. Here on meiert.com I share some of my views and experiences. (Be critical, interpret charitably, and send feedback.)
Comments (Closed)
-
On February 18, 2009, 11:09 CET, Kroc Camen said:
Most excellent, I really look forward to your findings. This syntax will be especially pertinent to the regex I use for publishing.
-
On February 18, 2009, 21:49 CET, potherca said:
I come from a back-end development background myself and for the last year or so Iâve been delving deeper and deeper into the front-end. This is one of those fun little quirks I really enjoy to encounter⊠Just thinking out loud here, but I wonder how this compliments/collides with (for example) user-input validation?
Looking explicitly for ahttp://
isnât necessary⊠things could be greatly simplified. Links only need to be/
(on-site) or//
(off-site).What fun đ
Like the right honorable K. Camen, I to am looking forward to your findings⊠Keep us informed!
-
On February 18, 2009, 23:36 CET, Keith Bell said:
Jens, I wasnât aware of that before. Itâs interesting in a âmaybe Iâll find a use for that one dayâ kind of way.
I wonder if the syntax is supported well by mobile user agents.
-
On February 19, 2009, 9:12 CET, Francesco said:
Thatâs pretty interesting! Iâm looking always for ways to trim my code as much as possible. Looking foward to your results!
-
On February 23, 2009, 9:57 CET, Gunnar Bittersmann said:
Why do you refer to RFC 2396 which has been obsoleted by RFC 3986 for 4 years?
-
On February 23, 2009, 10:03 CET, Jens Oliver Meiert said:
Gunnar, maybe because RFCs just state what they make obsolete, not by what they became obsolete. Thanks for the reference.
Letâs call this post âPerformance and RFC 2396/3986â then đ
-
On February 23, 2009, 16:51 CET, Gunnar Bittersmann said:
Hm, funny. The HTML version of RFC 2396 lists âObsoleted by: 3986â and âUpdated by: 2732â; the plain text version does not.
-
On April 15, 2009, 20:29 CEST, Steven Black said:
Works in IE and Firefox. But Chrome resolves â//â as âfile://â.
Read More
Maybe of interest to you, too:
- Next: Another Survey (Including Website Usability Scale Template)
- Previous: Arial, Helvetica
- More under Development
- More from 2009
- Most popular posts
Looking for a way to comment? Comments have been disabled, unfortunately.
Get a good look at web development? Try WebGlossary.infoâand The Web Development Glossary 3K (2023). With explanations and definitions for thousands of terms of web development, web design, and related fields, building on Wikipedia as well as MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.