Skip to content
Web Design & Development

How to Get Laravel Deployment Optimization Right

The steps that make Laravel applications fast and reliable in production, such as caching configuration and routes, and running queue workers properly.

MediaScaleUp Editorial Team 2 min read 14 views
How to Get Laravel Deployment Optimization Right

What is at stake

Skipping production optimizations leaves performance on the table, and misconfigured deployments cause outages.

The playbook

  1. Cache config, routes and views on deploy
  2. Disable debug mode in production
  3. Restart queue workers after deploying
  4. Run migrations as part of a controlled release
  5. Monitor errors after each deploy

Where it goes wrong

Avoid:

  • APP_DEBUG enabled in production
  • Calling env() outside config files when config is cached
  • Stale workers running old code
  • Deploying without backups
What to do and what to avoid with Laravel deployment optimization, side by side
Good practice against the usual mistakes, from the sources listed below.

The numbers behind it

Published figures for Laravel Deployment Optimization
MeasureFigure
Config cachingphp artisan config:cache
Route cachingphp artisan route:cache
Autoloader optimizationcomposer install with optimized autoloading
Debug modemust be off in production

Getting outside help

When to hand it over: Bring in help when Laravel deployments are manual or error-prone.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development