Gzip compression - pre-compression vs. on-the-fly

Dave Cheney dave at cheney.net
Mon Apr 14 11:58:01 MSD 2008


That notice is probably for two reasons

1. you have to deploy a patch to a css or js file on your production  
server, you forget to update the .gz version so browsers with  
different Accept-Encoding: headers see different results

2. I have noticed that nginx uses the last-modified timestamp of  
the .gz file if it delivers that file, this may or may not be a  
problem in your setup.

indy:~ dave$ curl -I http://www.redbubble.com/javascripts/prototype.js
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 14 Apr 2008 07:57:43 GMT
Content-Type: application/x-javascript
Content-Length: 75865
Last-Modified: Thu, 10 Apr 2008 02:26:50 GMT
Connection: keep-alive
Cache-Control: public,max-age=7776000
Accept-Ranges: bytes

indy:~ dave$ curl -I --compress http://www.redbubble.com/javascripts/prototype.js
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 14 Apr 2008 07:57:48 GMT
Content-Type: application/x-javascript
Content-Length: 20603
Last-Modified: Fri, 11 Apr 2008 22:59:02 GMT
Connection: keep-alive
Content-Encoding: gzip
Cache-Control: public,max-age=7776000

Cheers

Dave

On 14/04/2008, at 5:26 PM, mike wrote:

> gzip_static is what controls the precompression checks right?
>
> The wiki says this:
> "You should ensure that the timestamps of the compressed and
> uncompressed files match."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080414/bdc5a9fa/attachment.html>


More information about the nginx mailing list