如何强制片段缓存在rails从cron时间表? [英] How to force fragment cache on rails from cron schedule?

查看:165
本文介绍了如何强制片段缓存在rails从cron时间表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么方法可以触发一个页面被片段缓存,而没有人第一次加载页面?

Is there any way I can trigger a page to be fragment cached without having someone to load the page the first time?

我计划使用cron schedule,这是因为我的cron调度程序更新数据库,这是我想强制片段缓存发生。

I am planning to use cron schedule, this is because my cron scheduler updates the database and that's when I want to force the fragment cache to happen.

推荐答案

解决方案,但你可以总是有cron解除卷曲请求到您的页面的URL。

It's a primitive solution but you could always have cron fire off a curl request to the URL of your page(s).

这篇关于如何强制片段缓存在rails从cron时间表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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