jsp page cache

Bjørn Ruberg bjorn at ruberg.no
Wed Feb 8 09:05:49 CET 2012


Please reply to the list. Please do not top post.

On 08. feb. 2012 08:45, Jewel Nuruddin wrote:
> Hi
> I use force caching in varnish like below
> sub vcl_recv {
>
>
>         if (req.http.pragma ~ "no-cache" || req.http.Cache-Control ~ 
> "no-cache") {
>         return (lookup);
>         }
>
>         unset req.http.cookie;
>         return (lookup);
>
>         if (req.request == "GET" || req.request == "HEAD") {
>                 if (req.url ~ 
> "\.(png|gif|jpg|swf|css|js|jsp|html|htm)$") {
>                 return (lookup);
>                 }
>         }
>
> #       set req.backend = web;
> #       if ( (req.request == "GET") && (req.url ~ "\.jsp") ) {
> #               return(lookup);
> #               }
>
>         set req.backend = web;
> }
>
> But it can not cache .jsp file ?
>
> What I did mistake?

You are not considering set-cookie from the backend. This would be done 
in vcl_fetch, as detailed in the URL I referred to in my previous response.

Also, as mentioned, please include a varnishlog extract.

-- 
Bjørn




More information about the varnish-misc mailing list