HI,
I am fairly new to varnish, and was curious, is there a way to have all
traffic go through varnish to the backend without caching unless for
specific pages. For example we only want two pages to be cached, our home,
and a specific page under the home as seen below?
Here is my default.vcl
Thanks
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
# for the default home page
if (req.url ~ "^/") {
unset req.http.cookie;
}
# if they go directly to /samplepage
if (req.url ~ "^/samplepage") {
unset req.http.cookie;
}
}
sub vcl_fetch {
if (req.url ~ "^/") {
unset beresp.http.set-cookie;
}
if (req.url ~ "^/samplepage") {
unset beresp.http.set-cookie;
}
#override cache headers from backend to keep element in cache for 5
minutes
if (beresp.ttl < 120s) {
set beresp.ttl = 360s;
}
}
_______________________________________________
varnish-misc mailing list
[email protected]
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc