Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 = "127.0.0.1";
    .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
add comment

1 Answer 1

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!

https://www.varnish-cache.org/trac/wiki/VCL

https://www.varnish-cache.org/trac/wiki/VCLExamples

share|improve this answer
add comment

Your Answer

 
discard

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.