Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Server file compression


fside - 12:09 am on Mar 12, 2008 (gmt 0)


Cameraman, as I understand it, one can gzip a file, upload it to the server with a file of the same name, but with the .js suffix, and something like the script I posted, previously, would rewrite things and return the gzipped file, not the .js. And the browser would 'inflate' and use it as the originally requested .js. But it didn't work. The server kept sending out the .js.

Now I do get gzip in the response. But I also get the word - chunk. And that could be slowing things down. Whatever the reason, it seems that transfer time is unusually long for a file that should compress down to about 20K. It seems like the entire thing is being served, and even more? Here's an example response:

One of the .jpg files:

HTTP/1.x 200 OK
Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Etag: "d4c69bfd-5fbe-a4965b80"
Accept-Ranges: bytes
Content-Length: 29510
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: image/jpeg

This goes by quickly.

The one .js file, which should compress to about 20K:

HTTP/1.x 200 OK
Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Etag: "1c3c3c59-b63e-54e59140"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/javascript

This seems to hold things up too long.


Thread source:: http://www.webmasterworld.com/php/3595628.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com