Making a dummy request to the backend on cache hit

Sam Crawford samcrawford at
Wed Aug 3 15:45:37 CEST 2011

Hi Connor,

If you're just looking to do this in order to catch missing logs, how
about enabling logging on Varnish using varnishncsa? This will give
you Apache-style logs that you could parse in addition to (or instead
of) your existing ones.



On 3 August 2011 14:29, Connor Walls <connor.walls at> wrote:
> Hi,
> I've had a look around the VCL documentation, and I reckon this will
> probably only be possible by using inline C, but I wanted to make sure.
> We're having a minor issue in that whenever an object is served from the
> cache, the lack of a request to the backend server means that the server is
> unable to record a log for that page being accessed (as is to be expected).
> A possible solution that has been put forward is to make a sort of "dummy"
> request to the backend whenever the cache is hit, i.e. the user is served a
> page from the cache (so the user gets the content immediately), and a
> request is made to the backend server, with a particular header or variable
> that tells the backend not to attempt to render the page, merely to record
> the request in the logs.
> Is this something that is feasible in vanilla VCL, or would it require
> inline C? Are there any obvious problems to this that I'm not seeing? The
> main issue I see being that the request volume to the backend server will
> remain high even with content being served from the cache, but with the
> server not performing any rendering or serving any content, I reckon this
> will be a minor issue.
> Thanks in advance for any help,
> Connor
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at

More information about the varnish-misc mailing list