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:
- Go to Stores > Configuration > Advanced > System
- Set Full Page Cache to "Enabled"
- 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:
- Export Varnish VCL via Stores > Configuration > Advanced > System
- Install the VCL on your Varnish server
- 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.
Related articles
What is web hosting? Explanation for beginners
Discover what web hosting is and how it works. Complete explanation about servers, domains and different hosting types for beginners.
What is VPS Hosting?
VPS hosting explained: what is a Virtual Private Server, who is it suitable for and what are the advantages compared to shared hosting?
What is an SSL Certificate?
Everything about SSL certificates: what is SSL, why do you need it and how do you recognize a secure website? Essential for every website.
What is Uptime in Web Hosting?
What does uptime mean in web hosting? Learn about uptime percentages, SLA guarantees and why 99.9% uptime is important for your website.
How much storage do I need for my website?
Discover how much disk space you really need for your website. Practical guide with examples per website type.