jsp page cache

Savetheinternet savetheinternet at tinyboard.org
Wed Feb 8 06:47:11 CET 2012


Hi,

The file extension should be irrelevant unless you specify otherwise.
You should take a read of some of the VCL examples here:
https://www.varnish-cache.org/trac/wiki/VCLExamples.

Below is wholly untested sample code for explicitly caching .jsp files
for 1 hour.

--

sub vcl_recv {
        # match .jsp files
        if(req.url ~ "\.jsp$") {
                return (lookup);
        }
        # [...]
}

sub vc_fetch {
        if(req.url ~ "\.jsp$") {
                # set ttl for one hour
                set beresp.ttl = 1h;
        }
        # [...]
        return (deliver);
}

--

Thanks,
Michael

On Wed, Feb 8, 2012 at 4:37 PM, Jewel Nuruddin
<jewel.nuruddin at eastbeam.co.jp> wrote:
> Hello,
> My varnish could not cache .jsp page.
> Can any body help me how can I cache .jsp page?
> Thanks
> Jewel
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list