Symfony预热缓存在部署之前? [英] Symfony warmup cache before deploying?

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

问题描述

在我工作的地方,我们无法直接访问服务器,只能通过SFTP进行访问,因此我们无法执行以下命令行命令:

Where I work we don't have direct access to the server, only via SFTP, so we can not execute command line commands like:

php bin/console cache:warmup --env=prod

因此,在部署之后我无法真正预热缓存.使用上面的命令在本地预热缓存也不起作用,因为它使用了应用程序的当前位置,并且当我将其上传到服务器时,它会返回错误.

Because of that I can't really warmup the cache after deploying. Warming up the cache locally using the command above also does not work because it uses the current location of the app, and when I upload it to the server it gives an error back.

单击每个页面以分别缓存它们也不是一种选择,因为服务器加载页面的时间太长(未缓存时),并且连接因时间限制而中断.

Clicking every page for caching them separately is also not an option because the server takes too long to load the page (when it is not cached) and the connection is interrupted by time limit.

在将应用程序部署到其他地方之前,有什么方法可以预热缓存?例如,更改目标位置?

Is there any way to warmup the cache before deploying the application to somewhere else? Like, changing the target location?

推荐答案

您可以根据部署方法进行预热.或查看 ConsoleBundle ,它为您提供了控制台的Web界面.别忘了保护它!

Depending on your deployment method you can pre warmup. Or have a look at ConsoleBundle that gives you a web ui for the console. Don't forget to protect it!

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

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