Problem with ESI, gzip, Accept-Encoding-Normalisation and 404-Status

Michael Borejdo mib at electronic-minds.de
Thu Apr 12 19:46:30 CEST 2012


Hello List, 

I am facing this problem:

I have a page with a few esi:includes, which gets cached and served correctly.
My 404-Page has a similar structure. (not getting cached)
I am using the "Accept-Encoding"-Normalisation-snippet and remove the accept-encoding header for images et. al.
So far so good.

Now I am requesting a non-existent image (http://example.com/foo.jpg).
Varnish sees the .jpg and removes the accept-encoding header.
Since the resource is missing, my 404-page is served. (I do not rewrite the uri).
The 404-Page is served uncompressed (since we unset the accept-encoding) but contains gzipped esi:include blocks 
(now showing binary characters/data in the browser)

What am I doing wrong?

Thanks

Michael




More information about the varnish-misc mailing list