Communication between Varnish and the Backend
hugues.alary at gmail.com
Fri Mar 16 23:42:33 CET 2012
I'm configuring varnish to be used with my web application.
I need my backend to be able to give instructions to Varnish depending on
the page requested. For example, some of my pages contain ESI includes,
I want my application to tell varnish wether or not do the esi
processing. This approach allows me to keep my VCL configuration file
abstracted from the application. I can then redistribute the VCL to other
users and let their application control the cache.
So far my solution is to instruct varnish via HTTP headers.
In my current example I set a header X-Application-DoEsi to 1 or 0. When
varnish receives the response from the backend, it looks for the value
of X-Application-DoEsi and does or not the ESI processing.
- I was wondering if communicating with varnish via HTTP header is a
- How bad can it be performance wise?
- Should I be worried about security (interception/modification of the
communication between Varnish and the backend), even if no credential will
never be sent through HTTP headers? (Also, currently Varnish and the
backend are on the same machine, but chances are that they will in the
future not live on the same host).
In the future, I plan on instructing varnish not to cache certain pages
containing user defined query strings. I want the user to be able to
specify these un-cachable urls query strings directly in the application.
The application will then send the un-cachable query strings in a header
Is that a bad idea?
Thank you for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the varnish-misc