Weblog entry #73 for Steve
I had the following in one the CSS files this site uses:
background: url("/images//sidebar-bg-right.png") 100% 0% repeat-y;
Strangely Mozilla couldn't tell that this image was the same as /images/sidebar-bg-right.png (a file which it has already loaded). This lead to each incoming new page request loading both the files:
- /images/sidebar-bg-right.png
- /images//sidebar-bg-right.png
Now I've removed the extra '/' character I'm saving about 4k of transfer per new-connection.
Nifty. But a little annoying that I hadn't noticed for so long.
Comments on this Entry
Probably a typo by me!
But I don't understand how two //s are handled by a browser. It must see the two //s differently than a single /, but ends up getting the same file in the end. Interesting. Is it what it supposed to do?
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
I think the browser should be smart enough to realise the two URIs point to the same resource - so it should know that its cached copy is OK.
I can't think of any situation where there is a difference between "/", "//", or "//////". I'd check the spec but I'm too tired right now!
[ Parent | Reply to this comment ]
Steve, quotes got parsed the wrong way for the titles in the above two comments.
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
So they did. I'll look into it, thanks.
[ Parent | Reply to this comment ]
Interesting to note that I removed the character entities from the title of #3 , and typed in the quotes manually. They were again fuzzed and parsed wrongly.
[ Parent | Reply to this comment ]