Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Seems Varnish is caching too aggressively, e.g. I have a index.php does not send out last-modifieid, cache-control, Varnish still cache it.

my default.vcl

backend default {
    .host = "";
    .port = "8080";

Is it possible to turn off this strange behaviors?

share|improve this question
Specifically tell varnish not to cache it then, or do the right thing and send proper headers. – 3molo Mar 24 '12 at 12:17
up vote 0 down vote accepted

Varnish by default will cache as much as possible - to the TTL (Time To Live) it was set when it's daemon was started.

If your index.php doesn't send Cache-Control headers, varnish will try to cache it, unless that page sends (or recieves) a cookie from the user.

You can control exactly what varnish is doing (to an extremely fine degree) using Varnish Control Language; normally putting things in 'vcl_recv' and 'vcl_fetch'.

The varnish wiki is very good, have a look at the config examples. Also, you can find tonns of stuff by googling it!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.