Skip to content

Speed up Magento: complete optimization guide

Last updated: 31 December 2025

A slow Magento store costs you customers and revenue. Every second of delay can reduce your conversion by 7%. Fortunately, there are many ways to speed up Magento.

Why is Magento slow?

Magento is a complex platform with many features. This makes it powerful but also heavy. Common causes of slowness:

  • Insufficient server resources
  • No caching configured
  • Too many extensions
  • Unoptimized images
  • Slow database queries

Step 1: Enable caching

Magento has built-in caching that isn't fully active by default.

Enable Full Page Cache:

  1. Go to Stores > Configuration > Advanced > System
  2. Set Full Page Cache to "Enabled"
  3. Choose Varnish as caching application (if available)

Activate cache types:

bin/magento cache:enable
bin/magento cache:flush

Step 2: Configure Varnish

Varnish is a reverse proxy that caches pages before they reach Magento.

Benefits of Varnish:

  • Pages load in milliseconds
  • Server load drops drastically
  • Can handle thousands of visitors simultaneously

Basic configuration:

  1. Export Varnish VCL via Stores > Configuration > Advanced > System
  2. Install the VCL on your Varnish server
  3. Test with: curl -I yourstore.com

Step 3: Redis for sessions and cache

Redis is faster than file-based caching.

In app/etc/env.php:

'cache' => [
    'frontend' => [
        'default' => [
            'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis',
            'backend_options' => [
                'server' => '127.0.0.1',
                'port' => '6379',
                'database' => '0'
            ]
        ]
    ]
]

Step 4: Optimize images

Images are often the biggest bottleneck.

Tips:

  • Use WebP format where possible
  • Compress images before upload
  • Enable lazy loading
  • Use a CDN for static content

Magento configuration: Stores > Configuration > General > Web > Optimize resource files

Step 5: Database optimization

A bloated database slows down queries.

Run regularly:

# Reindex
bin/magento indexer:reindex

# Clean logs
bin/magento cron:run --group=system

# Optimize database tables
mysqlcheck -o database_name

Step 6: Audit extensions

Every extension adds overhead.

Analyze extensions:

  • Remove unused extensions
  • Test performance with and without each extension
  • Choose quality extensions from reputable developers

Step 7: Production mode

Ensure Magento runs in production mode:

bin/magento deploy:mode:set production
bin/magento setup:static-content:deploy

Performance checklist

Optimization Impact Effort
Full Page Cache ⭐⭐⭐⭐⭐ Low
Varnish ⭐⭐⭐⭐⭐ Medium
Redis ⭐⭐⭐⭐ Medium
Image optimization ⭐⭐⭐ Low
Database cleanup ⭐⭐⭐ Low
Extension audit ⭐⭐⭐⭐ High

Measure your progress

Test your performance regularly:

  • Google PageSpeed Insights: Free, measures Core Web Vitals
  • GTmetrix: Detailed waterfall analysis
  • New Relic: Server-side monitoring (paid)

Aim for:

  • Time to First Byte (TTFB): < 200ms
  • Largest Contentful Paint: < 2.5s
  • First Input Delay: < 100ms

Was this article helpful?

Compare hosting packages directly to find the best choice for your situation.