I Guess Lenny Will Release
In September In October In November In December In January (2009) Later Still Whenever It Is Ready ( 848 votes ~ 2 comments )
You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.
To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.
This is the comment you were replying to, attached to the article Saving bandwidth when serving files with Apache2:
#3 Re:Saving bandwidth when serving files with Apache Posted by mahdi (217.113.xx.xx) on Mon 6 Jun 2005 at 23:05 If you are serving static files (by static I mean really static—without any server side scripting) there is better option—Content Negotiation. This way you have best of both worlds—low CPU usage and bandwidth savings. Just make sure you have MultiViews option enabled, and. . . you need to do little trickery :). Let's suppose you have two files example.html and example.html.gz—in ideal world when browser asks for example.html and declares compression support, Apache2 should have found gzipped version and serve that one. But in this case Apache finds exact match, so doesn't use content negotiation at all and just gives back founded file (at least my little test suggests that). Of course I'm writing this comment because there's workaround—rename your files to example.html.en and example.html.en.gz (or other language extension that reflects to document contents) but on other pages still refer to it by name example.html. Now Apache cannot find such file so starts content negotiation, finds both versions and chooses smaller one. Everything works fine... not exactly. What if user doesn't have en in browser's preferred languages list? Apache will return "406 Not Acceptable" and asks user which (compressed or not) document he prefers. To prevent this you need to force language preference by ForceLanguagePriority Fallback or ForceLanguagePriority Prefer directive (check which one suits you better). Now everything should work fine (ok, only when en is in Apache's LanguagePriority list :). It can also be done other way—stay with default example.html and example.html.gz names and change references to them to not contain .html extension to force content negotiation. But for me mass renaming looks like easier way than parsing all the files that may contain links for change. I should add that this is only roughly tested and I've never used it in real server. I had just thought about this method while reading the article and decided to do fast check if it works at all. So maybe something else should also be enabled or disabled to make it work properly in all cases. Anyway—looks like the article above should start with If you run website which is mostly serving dynamic files. . . (because for static pages you have better method ;-) I've just almost forgot about one drawback—price for such method is of course increased disk usage (you need both compressed and uncompressed files to be stored).
Posting Format:
Inappropriate comments will be removed.
Some help on entry formatting is available
Username:
Password:
[ Advanced Login ]
Register Account