PDA

View Full Version : Why is Google...



WakeMeUp
01-04-2010, 01:54 PM
.. not html validated? I was just wondering this. It'd cost something like 5$ i guess, at least for the homepage. :dry:

anon
01-04-2010, 03:10 PM
.. not html validated?

Bandwidth. When you're getting thousands of hits every second, every byte counts.

Barbarossa
01-04-2010, 03:19 PM
.. not html validated? I was just wondering this. It'd cost something like 5$ i guess, at least for the homepage. :dry:

What are you on about? :blink:

anon
01-04-2010, 03:20 PM
http://validator.w3.org/check?uri=www.google.com

Barbarossa
01-04-2010, 03:29 PM
OK cool! Cheers for that.

WakeMeUp
01-04-2010, 03:31 PM
Oh, that's interesting. Didn't think about that. But then, why do they leave the " in the href all of the <a> tags for example? Would work the same, without having those extra chars.

anon
01-04-2010, 03:43 PM
why do they leave the " in the href all of the <a> tags for example? Would work the same, without having those extra chars.

Unless the URL has a non URL-encoded space, in this case only everything before the space is linked to. Compare this:

<a href=http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi man>LINK</a>
With this:

<a href="http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi man">LINK</a>

The percent-encoding for an space is %20. By enclosing them between quotes, they save at least one byte for every URL with an space on it, Of course, two bytes are wasted for every search result that doesn't. I'd check if the search results page automatically chooses between using quote marks or not but I'm happy with Scroogle ;)

WakeMeUp
01-04-2010, 03:57 PM
Unless the URL has a non URL-encoded space, in this case only everything before the space is linked to. Compare this:

<a href=http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi man>LINK</a>
With this:

<a href="http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi man">LINK</a>

The percent-encoding for an space is %20. By enclosing them between quotes, they save at least one byte for every URL with an space on it, Of course, two bytes are wasted for every search result that doesn't. I'd check if the search results page automatically chooses between using quote marks or not but I'm happy with Scroogle ;)
No, you don't need that. You can replace the space with the + sign, and it would work the same. And looking at the code they use this method, but still do use the quote sign.

What a mistery. :lol:

anon
01-04-2010, 04:17 PM
You can replace the space with the + sign, and it would work the same.

I think that's only when you're replacing an space in a query string. This:

http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi+man
Would work, but this:

http://golf.sportec.es/reglas/REGLAS+2004-2008+_internet_Regla+20.pdf
Wouldn't. But if you replace the +'s with spaces in the second link, you'll be able to download the PDF.

WakeMeUp
01-04-2010, 05:28 PM
I think that's only when you're replacing an space in a query string. This:

http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw=hi+man
Would work, but this:

http://golf.sportec.es/reglas/REGLAS+2004-2008+_internet_Regla+20.pdf
Wouldn't. But if you replace the +'s with spaces in the second link, you'll be able to download the PDF.

That's right, + it's the separator and stands for the space (no mistery here, any get form will behave this way) in query strings. Those links are the only ones I can think google would use (for example see the images links in the homepage in anniversaries). Beside that, the use of quotation marks seems to be useless for the purpose of just-display-my-content. In fact, as you can see everything is url encoded in a proper way before being displayed. :)