Back to BlogMagento

Magento Performance Optimisation: Proven Strategies for Speed

Globify TeamFebruary 20, 2026 9 min read

Why Magento Performance Matters

Magento's power comes with complexity. The platform's modular architecture, dependency injection, and ORM layer add processing overhead that simpler platforms don't have. Without deliberate optimisation, Magento stores underperform—costing you revenue with every slow page load.

The Performance Stack

A well-performing Magento store requires a coordinated stack:

1. Web Server: Nginx or LiteSpeed

  • Nginx: Industry standard for Magento. Handles concurrent connections efficiently, serves static files directly, and proxies PHP requests to PHP-FPM.
  • LiteSpeed: Growing in popularity. Built-in caching, HTTP/3 support, and WordPress/Magento optimisation. Often faster than Nginx for Magento workloads.
  • Apache: Avoid for Magento in production. Higher resource consumption and lower concurrency handling.

2. PHP 8.2+ with OPcache

PHP 8.2 delivers 15–25% performance improvement over PHP 7.4 for Magento:

  • Enable OPcache with 256MB memory allocation
  • Set revalidation frequency to 60 seconds for production
  • Enable JIT compilation for additional 5–10% improvement
  • Allocate 2GB+ PHP memory limit for large catalogues

3. Varnish Full-Page Cache

Varnish is the single most impactful performance optimisation for Magento:

  • Caches complete HTML pages in memory
  • Serves cached pages in under 10ms (vs 2–3 seconds without)
  • Magento includes Varnish VCL configuration out of the box
  • Handles cache invalidation automatically when products or categories change

Configuration tips:

  • Allocate 2–4GB RAM for Varnish cache storage
  • Set TTL to 86400 seconds (24 hours) for product and category pages
  • Exclude cart, checkout, and customer pages from caching
  • Use Edge Side Includes (ESI) for dynamic content blocks on cached pages

4. Redis for Session and Cache

Redis replaces Magento's default file-based caching with in-memory storage:

  • Cache backend: Store Magento's cache, full page cache (if not using Varnish), and compiled config in Redis
  • Session storage: Move PHP sessions from files to Redis for faster session management
  • Configuration: Separate Redis instances for cache and sessions to prevent eviction conflicts

5. Elasticsearch

Magento's catalogue search powered by Elasticsearch:

  • Handles complex product filtering across large catalogues (100K+ SKUs)
  • Supports faceted search, synonyms, and weighted attributes
  • Allocate 2–4GB heap size for catalogues under 50K products
  • Configure index settings for your specific catalogue structure

Database Optimisation

MySQL/MariaDB Tuning

  • innodb_buffer_pool_size: Set to 70–80% of available RAM on dedicated database servers
  • query_cache: Disable (Magento's application-level caching makes it redundant and it adds overhead)
  • innodb_log_file_size: 256MB–1GB for transaction-heavy stores
  • max_connections: Set based on PHP worker count + admin connections

Regular Maintenance

  • Reindex Magento indexes on schedule (not just on save)
  • Clean expired quotes and sessions from database
  • Archive old orders to separate tables
  • Analyse slow query log and optimise problematic queries
  • Remove unused product attributes to reduce EAV table size

Frontend Optimisation

CSS and JavaScript

  • Enable Magento's built-in CSS and JS merging and minification
  • Use critical CSS to inline above-the-fold styles
  • Defer non-essential JavaScript loading
  • Consider removing jQuery where possible (significant payload reduction)

Image Optimisation

  • Enable WebP conversion for all product images
  • Implement lazy loading for below-the-fold images
  • Configure responsive images with srcset
  • Set appropriate quality levels (80% for JPEG, lossless for WebP)
  • Use an image CDN (Cloudinary, imgix) for automatic optimisation

Theme Performance

  • Minimise the number of CMS blocks loaded per page
  • Avoid complex nested layouts that multiply database queries
  • Use knockout.js components sparingly (each adds initialisation overhead)
  • Profile theme customisations with Query Monitor or Mage2.tv profiler

CDN Configuration

Recommended CDNs

  • Fastly: Included with Adobe Commerce Cloud. Excellent Magento integration with edge-side logic.
  • Cloudflare: Popular for self-hosted Magento. Free tier covers basics; Pro adds optimisation features.
  • AWS CloudFront: Best for stores already on AWS infrastructure.

CDN Setup

  • Serve all static assets (CSS, JS, images, fonts) from CDN
  • Configure separate CDN origins for media and static content
  • Set long cache TTLs for versioned assets
  • Use CDN-level image optimisation where available

Load Testing

Before major sales events, load test your store:

  • Tools: Gatling, k6, or Apache JMeter
  • Targets: Test realistic user journeys (browse → search → product → cart → checkout)
  • Thresholds: Page loads under 3 seconds at expected peak traffic
  • Scale: Test at 2x expected peak to identify breaking points

Monitoring

Essential Monitoring

  • New Relic or Datadog: Application performance monitoring with Magento-specific instrumentation
  • Uptime monitoring: Pingdom, UptimeRobot for downtime alerts
  • Error tracking: Sentry or Bugsnag for real-time error detection
  • Log analysis: ELK stack or Papertrail for centralised log management

Key Metrics to Track

MetricTarget
TTFB (cached)< 100ms
TTFB (uncached)< 1 second
Full page load< 3 seconds
LCP< 2.5 seconds
FID< 100ms
CLS< 0.1

Performance Checklist

  • [ ] PHP 8.2+ with OPcache and JIT enabled
  • [ ] Varnish full-page cache configured and tested
  • [ ] Redis for cache and session storage
  • [ ] Elasticsearch optimised for catalogue size
  • [ ] MySQL/MariaDB tuned for workload
  • [ ] CDN serving all static assets
  • [ ] Images converted to WebP with lazy loading
  • [ ] CSS/JS minified and merged
  • [ ] Critical CSS inlined
  • [ ] Regular database maintenance scheduled
  • [ ] Load testing completed for peak scenarios
  • [ ] Monitoring and alerting configured

Store running slow? Globify's Magento performance team delivers measurable speed improvements. Book a free performance audit today.

Frequently Asked Questions

Why is Magento so slow?

Magento's modular architecture and ORM layer add overhead to every request. Without proper caching (Varnish, Redis), optimised hosting, and frontend optimisation, page loads can exceed 5 seconds. Proper configuration brings this under 2 seconds.

Does Magento need Varnish cache?

For production stores, Varnish is practically required. It caches full pages in memory and serves them without hitting PHP or the database, reducing Time to First Byte from 2–3 seconds to under 100ms for cached pages.

Ready to Take the Next Step?

Let Globify help you implement these strategies for your business in the UAE or India.