Gzipping xhtml pages

Igor Sysoev igor at sysoev.ru
Fri Nov 27 16:34:00 MSK 2009


On Fri, Nov 27, 2009 at 01:27:16PM +0000, Dave Kennard wrote:

> I'm having trouble in getting Nginx to gzip my pages that are served as 
> application/xhtml+xml
> 
> In my nginx.conf http block I have the following:
> /    gzip  on;
>     gzip_comp_level 3;
>     gzip_proxied any;
>     gzip_types text/plain text/html text/css application/x-javascript 
> text/xml application/xml application/xhtml+xml application/xml+rss 
> text/javascript;//
> 
> /In mime.types I commented out the existing xhtml entry and added
> /    application/xhtml+xml          xhtml;/
> //
> So a plain text file with .xhtml extension is served with content-type 
> application/xhtml+xml, but it is not being gzipped for some reason? CSS 
> and javascript are being gzipped okay though.
> 
> The response headers for my test xhtml page look like this:
> /HTTP/1.1 200 OK
> Server: nginx
> Date: Fri, 27 Nov 2009 13:23:33 GMT
> Content-Type: application/xhtml+xml
> Connection: keep-alive
> Content-Length: 11
> Last-Modified: Fri, 27 Nov 2009 13:13:42 GMT
> Accept-Ranges: bytes/
> 
> Can anyone help me get my pages gzipped with content type header of 
> /application/xhtml+xml/?

Because, by default gzip_min_length is 20. The page is too small.


-- 
Igor Sysoev
http://sysoev.ru/en/




More information about the nginx mailing list