“预热缓存”部署 [英] "Warm Up Cache" on deployment

查看:141
本文介绍了“预热缓存”部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道有没有人有任何插件或capistrano食谱,将通过在部署时构建所有页面缓存的html,或在部署发生之前在本地预加热一个rails应用程序的页面缓存。



我有一些大多数静态网站没有太大的变化,如果html已经写好,而不是要求一个访问者访问该网站,它会运行得更快。

解决方案

而不是自己创建自己(看起来很容易,但是它的优先级) / div>

我已经设置了确认网站所有主要区域(总共几百页)的集成测试。他们不做任何改变数据的事情 - 只是拉回页面和表单。



当我部署我的生产实例时,我目前没有运行它们,但现在你提到它 - 这实际上可能是一个好主意。



另一个替代方法是拉出站点地图中出现的每个页面(如果有的话,你可能应该) 。写一个gem / rake脚本应该是很容易的。


I am wondering if anyone has any plugins or capistrano recipes that will "pre-heat" the page cache for a rails app by building all of the page cached html at the time the deployment is made, or locally before deployment happens.

I have some mostly static sites that do not change much, and would run faster if the html was already written, instead of requiring one visitor to hit the site.

Rather than create this myself (seems easy but it lowwwww priority) does it already exist?

解决方案

I have set integration tests that confirm all of the main areas of the site are available (a few hundred pages in total). They don't do anything that changes data - just pull back the pages and forms.

I don't currently run them when I deploy my production instance, but now you mention it - it may actually be a good idea.

Another alternative would be to pull every page that appears in your sitemap (if you have one, which you probably should). It should be really easy to write a gem / rake script that does that.

这篇关于“预热缓存”部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆