简体   繁体   English

如何在Heroku上刷新Varnish缓存

[英]How to flush Varnish cache on Heroku

Is there a way to force a flush (purge) of the varnish cache on heroku? 有没有办法在heroku上强制刷新(清除)清漆缓存? After git push heroku master my old (and wrong) cache is still in place. git push heroku master我的旧(错误的)缓存仍然存在。

UPDATE : I tried to set varnish = 0 then commit & push heroku +master again 更新:我试图设置清漆= 0,然后提交并再次推送heroku + master

-      response.headers['Cache-Control'] = 'public, max-age=604800'
+      response.headers['Cache-Control'] = 'public, max-age=0'

but doesn't help ... 但无济于事...

UPDATE : I tried an heroku restart but doesn't help ... 更新:我尝试heroku restart但无济于事...

UPDATE : Until now seems there's no official way to manually expire your Varnish cache on Heroku ( see the post heroku-force-clear-varnish-cache ). 更新:到目前为止,似乎还没有正式的方法可以在Heroku上手动使您的Varnish缓存过期(请参阅heroku-force-clear-varnish-cache帖子)。 I just open an issue on Heroku support, let see what they'll say ... 我刚刚打开了有关Heroku支持的问题,让我们看看他们会说些什么...

Apparently things went ok by itself after the last heroku restart ( notice, I already did the same several times without success ), notice X-Varnish num on the following query: 显然,在最后一次heroku restart后,事情本身就正常了(请注意,我已经做了几次相同的操作而没有成功),请注意以下查询中的X-Varnish num:

BEFORE RESTART: 重新启动之前:

lsoave@ubuntu:~/rails/github/gitwatcher$ curl -I PURGE http://gitwatcher.com/ curl: (6) Couldn't resolve host 'PURGE' HTTP/1.1 200 OK Server: nginx Date: Sat, 26 May 2012 19:16:01 GMT Content-Type: text/html; lsoave @ ubuntu:〜/ rails / github / gitwatcher $ curl -I PURGE http://gitwatcher.com/ curl:(6)无法解析主机'PURGE'HTTP / 1.1 200 OK服务器:nginx日期:Sat,26 2012年5月19:16:01 GMT内容类型:text / html; charset=utf-8 Connection: keep-alive X-Ua-Compatible: 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; charset = utf-8连接:与X-Ua兼容的活着:IE = Edge,chrome = 1 Etag:“ f5a232e0193cfc6ad55c7b19033552b5”缓存控制:max-age = 0,专用,必须重新验证Set-Cookie:_rails3-mongoid -omniauth-simple_session = BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTk0YTk3YTFlYWU5ZjMwYmE4M2Y3MzBlZGE5NWE5ZTYzBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMTFpL0pKbHl0OFRLYnpoZFJCbmlrKytOUmRKWi9Kd0MxdExPektUVTErOUk9BjsARg%3D%3D - 826c4f58013b8a28da1544ab455ac928e1d8c961; path=/; 路径= /; HttpOnly X-Request-Id: bd82e473e163a47f57440e351d2757ce X-Runtime: 0.021009 X-Rack-Cache: stale, invalid Content-Length: 8302 Accept-Ranges: bytes X-Varnish: 197775566 Age: 0 Via: 1.1 varnish HttpOnly X-Request-Id:bd82e473e163a163f4740574e351d2757ce X-Runtime:0.021009 X-Rack-Cache:stale,invalid Content-Length:8302 Accept-Ranges:bytes X-Varnish:197775566 Age:0 Via:1.1 varnish

AFTER RESTART 重启后

lsoave@ubuntu:~/rails/github/gitwatcher$ curl -I PURGE http://gitwatcher.com/ curl: (6) Couldn't resolve host 'PURGE' HTTP/1.1 200 OK Server: nginx Date: Sat, 26 May 2012 19:18:12 GMT Content-Type: text/html; lsoave @ ubuntu:〜/ rails / github / gitwatcher $ curl -I PURGE http://gitwatcher.com/ curl:(6)无法解析主机'PURGE'HTTP / 1.1 200 OK服务器:nginx日期:Sat,26 2012年5月19:18:12 GMT内容类型:text / html; charset=utf-8 Connection: keep-alive X-Ua-Compatible: IE=Edge,chrome=1 Etag: "495098767d9e77dc52081d8de3f4b27e" Cache-Control: max-age=0, private, must-revalidate Set-Cookie: _rails3-mongoid-omniauth-simple_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWRkNTZiZDQ1YmY5YzhjM2Y3MTRiNmEwZjg4Y2YyMGE1BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVpKZWlScGNmWGtkRnZ3OFZOQWRDOGhVZWZ6WlNEN0dMYlVOZzFxc0NhVVU9BjsARg%3D%3D--51d21b9b6c039eacece832c8fc17c221393a86b2; charset = utf-8连接:与X-Ua兼容的活着:IE = Edge,chrome = 1 Etag:“ 495098767d9e77dc52081d8de3f4b27e”缓存控制:max-age = 0,专用,必须重新验证Set-Cookie:_rails3-mongoid -omniauth-simple_session = BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWRkNTZiZDQ1YmY5YzhjM2Y3MTRiNmEwZjg4Y2YyMGE1BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVpKZWlScGNmWGtkRnZ3OFZOQWRDOGhVZWZ6WlNEN0dMYlVOZzFxc0NhVVU9BjsARg%3D%3D - 51d21b9b6c039eacece832c8fc17c221393a86b2; path=/; 路径= /; HttpOnly X-Request-Id: 002d2081c7b55c3edf7070316a216c28 X-Runtime: 0.016595 X-Rack-Cache: stale, invalid Content-Length: 8302 Accept-Ranges: bytes X-Varnish: 1359484771 Age: 0 Via: 1.1 varnish HttpOnly X-Request-Id:002d2081c7b55c3edf7070316a216c28 X-Runtime:0.016595 X-Rack-Cache:陈旧,无效Content-Length:8302 Accept-Ranges:字节X-Varnish:1359484771 Age:0 Via:1.1 varnish

lsoave@ubuntu:~/rails/github/gitwatcher$ lsoave @ ubuntu:〜/ rails / github / gitwatcher $

Nobody still respond to my Request #53071 , from Heroku support. 仍然没人响应Heroku支持人员对我的#53071请求的回复 Things just works ... If you have any idea about this delay or happened to you too, please post your experience. 一切正常……如果您对此延迟有任何想法,或者也发生在您身上,请发表您的经验。

UPDATE: My last two answers fror Heroku/support: 更新:我的最后两个答案来自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. 2012年5月31日15:09我们最近升级了清漆版本,目前正在调查其对缓存清除操作的影响。 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. 上午1:02(23小时前)我们已经有一段时间没有收到您的回复,因此我们将此票标记为已解决。 If you have further comments, please feel free to reopen the ticket at http://support.heroku.com/tickets/53071 . 如果您有其他意见,请随时通过http://support.heroku.com/tickets/53071重新打开故障单。 Otherwise, feel free to open a new issue here` http://support.heroku.com/tickets/new . 否则,请随时在此处打开一个新问题` http://support.heroku.com/tickets/new

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM