Performance and RFC 2396
This and many other posts are also available as a pretty, well-behaved ebook: On Web Development.
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.
I’m Jens Oliver Meiert, and I’m a web developer (engineering manager) and author. I love trying things, sometimes including philosophy, art, and adventure. Here on meiert.com I share some of my views and experiences.
If you have questions or suggestions about what I write, please leave a comment (if available) or a message.
Most excellent, I really look forward to your findings. This syntax will be especially pertinent to the regex I use for publishing.
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 a
http://isn’t necessary… things could be greatly simplified. Links only need to be
What fun 😉
Like the right honorable K. Camen, I to am looking forward to your findings… Keep us informed!
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!
Why do you refer to RFC 2396 which has been obsoleted by RFC 3986 for 4 years?
Works in IE and Firefox. But Chrome resolves “//” as “file://”.
Have a look at the most popular posts, possibly including:
Perhaps my most relevant book: CSS Optimization Basics (2018). Writing CSS is a craft. As craftspeople we strive to write high quality CSS. In CSS Optimization Basics I lay out some of the most important aspects of such CSS. Available at Amazon, Google Play Books, and Leanpub.
Looking for a way to comment? Comments have been disabled, unfortunately.