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?
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.
| writing contests writing books how to get published writing instruction writing workshops writing tutorials |
Post a comment (or leave a trackback)