Search code examples
phpsymfonycachingsymfony-3.3

Symfony warmup cache before deploying?


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?


Solution

  • 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!