Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[suggestion] Automatic GZip of index pages

Quote Reply
[suggestion] Automatic GZip of index pages
Can anyone think of an elegant way to do this?

I'm putting up a large number of research documents, average filesize about 100kb. To reduce bandwidth usage, I have gzipped them all, and use .htaccess directives to pass the gzipped version to user agents that can accept gzip encoding (other agents get the uncompressed version).

Here is the .htaccess fragment that does it ...
Code:
RewriteEngine on
RewriteOptions Inherit
RewriteBase /research/
RewriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.+)$ $1.gz [L]


This method saves me significant bandwidth, at least 65%.

Now I would like to use it in our new LinksSQL directory. Ideally, as all the pages get rebuilt evrry 24 hours, I would like to have automatic gzipping plugged into the nph-build routines, ie: so that each directory contains index.html and index.html.gz -- also gzipped versions of all the detailed pages, eg: 200.html and 200.html.gz

Writing a shell script to do it would be trivial, but not a good long-term solution. I'm guessing that a LinksSQL modification to do it would be relatively easy -- but I'm a Perl novice, and don't yet know much about LinksSQL internals, so the risk of unanticipated side-effects would be high.

How about it GT? It would take you about five minutes, and I'm sure it would be very popular.
Quote Reply
Re: [YoYoYoYo] [suggestion] Automatic GZip of index pages In reply to
Hi,

Is there a reason you don't want to use mod_gzip instead:

http://www.remotecommunications.com/apache/mod_gzip/

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] [suggestion] Automatic GZip of index pages In reply to
In Reply To:
Is there a reason you don't want to use mod_gzip instead
I want to, but can't ... shared server, not installed, can't use it ... but .htaccess directives seem to be just as useful.
Quote Reply
Re: [YoYoYoYo] [suggestion] Automatic GZip of index pages In reply to
Surely it would be to the server admins advantage to install mod_gzip ?? It would cut down their bandwidth by a large amount Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!