Rewrite URLs with Content Negotiation

Wednesday, July 7th, 2004 at 4:57 PM | No comments Category: Meryl's Notes Blog

Content negotiation can make URLs shorter and more abstract. Save size and migration headaches by rewriting URLs without file extensions to the right resources. I asked the author, Andy King, a few questions about this method. He kindly responded:

Q: But wouldn’t it take up more space on the server if you have three versions of the image?

<

p>A: Yes, but storage is cheap, bandwidth isn’t. You don’t need three versions of an image. Also, you could just have one, say image.gif, but refer to <img src=”image” …> and either multiviews it, or explicitly say image.gif on the server. Apache is designed to do this type of content negotiation, and if port80software.com can do it, anybody can (see their home page, which is quite fast)

Q: How is it not slower… between parsing, searching for the file name instructions, and then sending it back to the browser?

A: It is infinitesimally slower, but worth it for the four bytes saved (at least) with each image/resource, and the hassle-free migration. Apache has been designed to do this from the start, but nobody uses it because of just the concerns you outline, but in practice the slowdown is not discernable (unless you are Yahoo, which i point out in the article). combined with compression say, it would be faster.

What about time to implement it? Isn’t it time consuming?

A: Not really, you just turn on multiviews, and remove extensions from your markup (which can also be automated) and it’ll work. You don’t need multiple representations of resources, that is just an expanded example.

Tags: Subscribe: RSS or E-mail

Post a comment (or leave a trackback)

RSS Subscribe to be notified when new comments are added.


Newsletter

Feeds

Or get site updates via e-mail:

Six Figure Writing Grow your business fast

travel_writer.gif 100x100_ad.gif

Ajax CommentLuv Enabled 83b24690a6c3878fd9a72af930c8ea6a