Caching without file extensions
- by Sigurs
I'm trying to use Varnish to show the non-logged in users a cached version of my website.
I'm able to perfectly detect if the user is logged in or out, but I can't cache pages without extensions.
There is no file extension because nginx is rewriting the URL to a php script(so caching .php does not work).
For example I'd like varnish to cache:
example.com
example.com/forum/
example.com/contact/
I have tried
if (req.request == "GET" && req.url ~ "^/") {
return(lookup);
}
if (req.request == "GET" && req.url ~ "") {
return(lookup);
}
if (req.request == "GET" && req.url ~ "/") {
return(lookup);
}
but nothing seems to work... any help?