当我的wordpress重定向具有302状态的页面时,我有清漆问题 .
我的环境:Varnish监听IP1:80后端(Apache)监听IP2:80站点类型:wordpress
结束两页: page1 , page2
我在wordpress中配置了302重定向,从 page1 到 page2 .
但即使_497434_已经被varnish缓存,在302重定向后请求 page2 时,varnish也不会从缓存中传递内容,而是将请求发送到后端!
那么问题是什么?我该如何解决?
提前致谢 .
1 回答
您需要缓存page1响应 .
我猜您的后端正在发送某种no-cache,max-age或expires标头,以防止Varnish缓存响应,因为默认行为是tu cache 302 status code [1] .
请附上第1页的完整请求的varnishlog以及您的VCL配置 .
[1] https://www.varnish-software.com/static/book/VCL_Basics.html#the-initial-value-of-beresp-ttl