Posts Learn Components Snippets Categories Tags Tools About

How to Cache Everything on Laravel Forge Deploy Scripts

Get to know how to cache your view, config, route, event and config in Laravel Forge to further boost the speed of your Laravel Project

Created on Jan 28, 2022


In this short snippet, you will learn how to boost your Laravel project by caching your view, route, event and config file on Laravel Forge. To do this it's quite straight forward and what you need to do is define it on the Deployment Script.
  1. Login to Laravel Forge
  2. Select Your Site
  3. Scroll to the "Deploy Script" section
  4. Copy and paste the command below
  5. Press the Update button
# clear any existing cache
php artisan view:clear
php artisan route:clear
php artisan event:clear
php artisan config:clear
php artisan auth:clear-resets

# cache everything that's possible
php artisan view:cache
php artisan route:cache
php artisan event:cache
php artisan config:cache

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️