views:

221

answers:

2

What does a zipped html file using zlib (deflate) look like sitting on the server? Does it have a different extension than .html?

+2  A: 

It has the extension you uploaded it with.

Note that if you ask the web server to serve deflated html pages, it will do so on-the-fly, and any caching it does will be somewhere other than your web site directory, so you won't actually see those files, if they are files at all.

In other words, if you're serving on-the-fly compressed files, you store the normal files on the server with the normal .htm or .html extensions.

Lasse V. Karlsen
+1  A: 

Depending on your webserver settings, it is also possible to zip the html files in advance, in addition to having the webserver automatically zip them. Usually the extension is .gz, eg MyPage.html becomes MyPage.html.gz. With the right settings, if someone requests http://example.com/MyPage.html, and Apache sees MyPage.html.gz, and the client supports compression, it will instead serve the MyPage.html.gz version. The client will then transparently decompress the content, and the user will not even know or care that it was compressed (except maybe being slightly happier that the page loaded a fraction of a second faster)

davr
Thanks. I am using an embedded web server (in C, which I am a newbie to). Do you have any idea where I could configure to serve the pre-zipped files? T
Tommy
Sorry, I can't really help with a custom written webserver, the settings depend on the webserver itself.
davr