Forum Moderators: open
If it is possible, any tips or tricks you might have for encoding web pages would be appreciated.
thx
I have an awful lot of pages on my web site and I am trying to save disk space.
GZIP encoding in the sense of HTTP and headers etc. isn't about saving disk space, it is about reducing the amount of data transfer.
A user-agent (such as a web browser or search engine spider) indicates that it will accept GZIP encoding within the request headers, and your web server can then compress pages on the fly as they are served. The user agent will uncompress them at the receiving end.
If you want to save disk space then you need to look at some other solution. I'm sure there's a way to keep your files gzipped' on the disk and have Apache deflate them when serving, but i've never investigated it - that's just an assumption.
If you want to save disk space then you need to look at some other solution.
Well, I must say that I use GZIP mainly to save disk space ;-)
I use GZIP to compress files offline. Then I upload these files to my server. When a page is requested, this compressed file will be decompressed in memory (on-the-fly), thus saving disk space.
Here's how it works:
When a user goes to [mydomain.com...] the widgets.cgi program will load the appropriate compressed binary file into memory, decompresses it on the fly, extracts what is needed, and shows the output.
In order to avoid server overload, I limit the size of compressed files so that they are less than 1MB when they are decompressed in memory. One file can hold data for hundreds of dynamically generated pages.