How to write VCL in varnish to do no caching

后端 未结 2 454
一向
一向 2021-01-26 06:55

I need to write VCL in Varnish so to prevent caching under certain conditions like cookie value.

Any idea how to do that?

2条回答
  •  粉色の甜心
    2021-01-26 07:10

    Place the following inside your vcl_recv:

    # as soon as we have a NO_CACHE cookie pass request
    if (req.http.cookie ~ "NO_CACHE=") {
        return (pass);
    }
    

提交回复
热议问题