关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。
想改进这个问题?将问题更新为 on-topic对于堆栈溢出。
1年前关闭。
Improve this question
有没有办法强制刷新(清除)heroku 上的 Varnish 缓存?之后 git push heroku master
我的旧(和错误)缓存仍然存在。
更新:我尝试设置 varnish = 0 然后再次提交并推送 heroku +master
- response.headers['Cache-Control'] = 'public, max-age=604800'
+ response.headers['Cache-Control'] = 'public, max-age=0'
但无济于事...
更新:我试过
heroku restart
但无济于事...更新:到目前为止,似乎没有官方方法可以手动使 Heroku 上的 Varnish 缓存过期(参见帖子 heroku-force-clear-varnish-cache)。我只是在 Heroku 支持上打开一个问题,看看他们会说什么......
最佳答案
显然,在最后一次 heroku restart
之后,一切都顺利了。 (注意,我已经做了几次同样的事情但没有成功),请注意以下查询中的 X-Varnish num:
重启前:
lsoave@ubuntu:~/rails/github/gitwatcher$ curl -I PURGE http://gitwatcher.com/
curl:(6)无法解析主机“PURGE”
HTTP/1.1 200 正常
服务器:nginx
日期:2012 年 5 月 26 日星期六 19:16:01 GMT
内容类型:文本/html;字符集=utf-8
连接:保持事件
X-Ua 兼容:IE=Edge,chrome=1
Etag:“f5a232e0193cfc6ad55c7b19033552b5”
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _rails3-mongoid-omniauth-simple_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTk0YTk3YTFlYWU5ZjMwYmE4M2Y3MzBlZGE5NWE5ZTYzBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMTFpL0pKbHl0OFRLYnpoZFJCbmlrKytOUmRKWi9Kd0MxdExPektUVTErOUk9BjsARg%3D%3D--826c4f58013b8a28da1544ab455ac928e1d8c961;路径=/; HttpOnly
X 请求 ID:bd82e473e163a47f57440e351d2757ce
X-运行时:0.021009
X-Rack-Cache:陈旧、无效
内容长度:8302
接受范围:字节
X- Varnish :197775566
年龄:0
通过:1.1 Varnish
重启后
lsoave@ubuntu:~/rails/github/gitwatcher$ curl -I PURGE http://gitwatcher.com/
curl:(6)无法解析主机“PURGE”
HTTP/1.1 200 正常
服务器:nginx
日期:2012 年 5 月 26 日星期六 19:18:12 GMT
内容类型:文本/html;字符集=utf-8
连接:保持事件
X-Ua 兼容:IE=Edge,chrome=1
电子标签:“495098767d9e77dc52081d8de3f4b27e”
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _rails3-mongoid-omniauth-simple_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWRkNTZiZDQ1YmY5YzhjM2Y3MTRiNmEwZjg4Y2YyMGE1BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVpKZWlScGNmWGtkRnZ3OFZOQWRDOGhVZWZ6WlNEN0dMYlVOZzFxc0NhVVU9BjsARg%3D%3D--51d21b9b6c039eacece832c8fc17c221393a86b2;路径=/; HttpOnly
X 请求 ID:002d2081c7b55c3edf7070316a216c28
X 运行时:0.016595
X-Rack-Cache:陈旧、无效
内容长度:8302
接受范围:字节
X- Varnish :1359484771
年龄:0
通过:1.1 Varnish
lsoave@ubuntu:~/rails/github/gitwatcher$
没人回复我的请求#53071 ,来自 Heroku 的支持。一切正常......如果您对这种延迟有任何想法或也发生在您身上,请发布您的经验。
UPDATE: My last two answers fror Heroku/support:
May 31, 2012 15:09 We recently upgraded our varnish version and are currently investigating the effect this has had on cache purge operations. To answer your question though, no, there is no way to manually purge an item from the cache. Our system is designed to flush all resources for your app's domains upon deploys.
1:02 AM (23 hours ago) We haven't heard back from you in a while, so we're marking this ticket resolved. If you have further comments, please feel free to reopen the ticket at http://support.heroku.com/tickets/53071. Otherwise, feel free to open a new issue here` http://support.heroku.com/tickets/new.
关于ruby-on-rails - 如何在 Heroku 上刷新 Varnish 缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10768039/