如何使 HTTP 响应“私有”与克隆人
我在 https://dev.plone.org/ticket/12345 报告了一个错误,因为view @@toggle-visibility 由 varnish 缓存,因此一旦隐藏 portlet,就无法更改它的可见性。
我有一个解决方法,将日期添加为请求的参数,但我想最好的解决方案是将 HTTP 响应设为私有。所以问题是实现这一目标的最佳方法是什么。
我知道 p.app.caching 更改响应标头以与清漆配合良好,但我不知道是否添加标头以使响应私有, plone.app.caching 会更改它吗?
I have reported a bug at https://dev.plone.org/ticket/12345 because the view @@toggle-visibility is cached by varnish, so you can't change the visibility of a portlet once you have hide it.
I have a workaround where I add the date as param of the request but I guess the best solution is to make the HTTP response private. So the question is what is the best way to achieve this.
I know p.app.caching change response header to play well with varnish, but I don't know if I add a header to make the response private is plone.app.caching will change it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除非明确配置这样做,否则 plone.app.caching 不会覆盖任意视图的缓存控制标头。
换句话说,除非您为
@@toggle-visibility
视图创建缓存规则来告诉 plone.app.caching 执行其他操作,否则该视图设置的 Cache-Control 标头将保持不变。Unless explicitely configured to do so, plone.app.caching will not overwrite cache control headers for arbitrary views.
In other words, unless you create a cache rule for the
@@toggle-visibility
view to tell plone.app.caching to do otherwise, the Cache-Control header set by that view will be left untouched.如果没有缓存标头,Varnish 将使用默认的 ttl。我们应该为重定向设置适当的缓存标头。我最近在 PAS 中修复了这个问题: http://zope3.pov.lt/ trac/changeset/121831/Products.PluggableAuthService/trunk
Where there are not caching headers, Varnish will use the default ttl. We should just set the appropriate caching headers for the redirect. I fixed this in PAS recently: http://zope3.pov.lt/trac/changeset/121831/Products.PluggableAuthService/trunk