如何在清漆中编写 VCL 以不进行缓存 [英] How to write VCL in varnish to do no caching

查看:24
本文介绍了如何在清漆中编写 VCL 以不进行缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Varnish 中编写 VCL,以防止在某些条件下(例如 cookie 值)进行缓存.

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

知道怎么做吗?

推荐答案

将以下内容放入您的 vcl_recv:

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);
}

这篇关于如何在清漆中编写 VCL 以不进行缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆