Altering response based on content-type

Poul-Henning Kamp phk at
Mon Sep 25 10:17:19 CEST 2006

In message <20060925075916.GK13253 at>, Trond Michelsen writes:
>I'm using Varnish as a cache for a WMS service, and this service will
>occasionally time out on a request. If it does it will return either
>an image with an error message, or an XML-file with the
>error-message. Unfortunately, both responses return the status code
>200 OK.
>The webclient doesn't handle the XML-response very well, and I don't
>want Varnish to cache the images containing error messages.
>So - is it possible to get Varnish to return a default image if the
>response from the server is an XML-file?

There are no headers we can detect instead ?

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list