Webreference.com uses automatic link abbreviation on their home page to maximize display speed. Like Yahoo!, Webreference.com uses mod_rewrite to create auto- expanding URLs.
Here is a RewriteMap snippet:
b dlab/ d dhtml/ g graphics/ h html/ p perl/ x xml/
Unlike Yahoo!, WebReference uses a RewriteRule that allows intelligent expansion of URLs. By ending popular directory values without slashes , and crafting the right regular expression, this RewriteMap entry:
dc dhtml/column
allows URLs like this:
/r/dc/66
to expand into this:
/dhtml/column66/
Here is a truncated version of Webreference.com's home page before abbreviation. So instead of this:
... top navigation bar snippet ... <tr><td class=y align=center><a href="/services/reference/"><b>Reference</b></a></td></ tr><tr><td><a href="/html/reference/color/">Color Codes</a><br><a href="/html/reference/ character/">HTML Characters</a><br><a href="/xml/reference/">XML</a></td></tr> <tr><td class=y align=center><a href="/services/"><b>Services</b></a></td></tr><tr><td><a href="http://refer-it.com/main.cfm">Affiliates</a><br><a href="/tools/browser/">Browser Sniffers</a><br> <a href="/services/dns/">Domains</a><br><a href="http://forums.internet.com/">Forums</ a><br><a href="/services/graphics/">Graphics</a><br> <a href="http://jobs.webdeveloper.com/">Jobs</a><br><a href="/services/news/">RSS News</ a><br><a href="/scripts/">Scripts</a><br><a href="/cgi-bin/search.cgi">Search</a><br><a href="/services/validation/">Validation</a><br><a ... main body content snippet ... <dt><a href="/js/column110/">JScript .NET, Part IV: Inheritance</a></dt><dd>Contrary to Mom's instructions,... <dt><a href="/programming/java/webservices/">Book Excerpt: Professional Java Web Services</a></dt><dd>Move over Microsoft... <dt><a href="/xml/column56/">Google SVG Search, Part II</a></dt><dd>Another module, another dozen lines, ... nav bar snippet (Web Dev Sites)... <a href="http://www.flashkit.com">FlashKit</a><br> <a href="http://www.gif.com">GIF.com</a><br> <a href="http://javaboutique.internet.com">Java Boutique</a><br> <a href="http://www.javascript.com">JavaScript.com</a><br> <a href="http://www.javascriptsource.com">JavaScript Source</a><br> <a href="http://jobs.webdeveloper.com">Jobs</a><br> <a href="http://www.justsmil.com">JustSMIL</a><br> ...
Do this:
<tr><td class=y align=center><a href="/r/sr"><b>Reference</b></a></td></tr><tr><td><a href="/r/hrc">Color Codes</a><br><a href="/r/hrh">HTML Characters</a><br><a href="/r/x/ reference/">XML</a></td></tr> <tr><td class=y align=center><a href="/r/s"><b>Services</b></a></td></tr><tr><td><a href="r/rfi/main.cfm">Affiliates</a><br><a href="/r/tb">Browser Sniffers</a><br> <a href="/r/sd">Domains</a><br><a href="r/sf">Forums</a><br><a href="/r/sg">Graphics</ a><br> <a href="r/jwd">Jobs</a><br><a href="/r/sn">RSS News</a><br><a href="/r/ss">Scripts</ a><br><a href="/r/cs">Search</a><br><a href="/r/sv">Validation</a> ... <dt><a href="/r/jc/110/">JScript .NET, Part IV: Inheritance</a></dt><dd>Contrary to Mom's instructions,... <dt><a href="/r/pg/java/webservices/">Book Excerpt: Professional Java Web Services</a></ dt><dd>Move over Microsoft... <dt><a href="/r/xc/56/">Google SVG Search, Part II</a></dt><dd>Another module, another dozen lines, ... <a href="r/fkt">FlashKit</a><br> <a href="r/gif">GIF.com</a><br> <a href="r/jbt">Java Boutique</a><br> <a href="r/jsc">JavaScript.com</a><br> <a href="r/jss">JavaScript Source</a><br> <a href="r/jwd">Jobs</a><br> <a href="r/jsm">JustSMIL</a><br> ...
In my quest for speed, I saved 5KB (over 20 percent) off Webreference.com's front page using abbreviated URLs. (We don't have quite as many links as Yahoo!.)
Overall, this auto-abbreviation technique saves from 20 to 28 percent off the HTML of these home pages. This savings makes URL abbreviation one of the most effective HTML optimization techniques available (other than converting to CSS and cutting out unnecessary fluff). The more links you have, the greater the savings.