使用max-age请求标头

时间:2012-03-15 20:36:15

标签: varnish varnish-vcl

如何配置VLC让Varnish尊重'Cache-Control max-age'请求标头?

我注意到默认情况下varnish提供缓存内容,即使我在浏览器中按F5(因此请求'新'副本')。

1 个答案:

答案 0 :(得分:0)

vcl_hit中,您可以执行以下操作:

if (req.http.Cache-Control ~ '\no-cache\b`) {
    purge;
    return (restart);
}

确保您已导入std vmod

import std;
相关问题