Performance
Hyvä is designed to be fast. Compared to Luma it ships far less JavaScript and CSS, avoids render-blocking resources, and includes features like Speculation Rules and bfcache out of the box. That said, a well-performing store still requires deliberate decisions throughout the project.
This chapter covers how to measure performance accurately, how to improve Core Web Vitals, and how to apply Hyvä-specific optimizations.
What is in this chapter
- Hyvä Performance Tips: Hyvä-specific techniques covering images, Alpine.js, CSS, and DOM size.
- Core Web Vitals: practical guidance on improving LCP, CLS, and INP scores for Hyvä storefronts.
- Measuring Performance: the right tools for lab data and real-world field data, from Lighthouse to RUM solutions.
- Speculation Rules: prefetching and prerendering pages for near-instant navigation.
- Back-Forward Cache: configuring bfcache for instant back and forward navigation.
- Magento Block HTML and Full Page Caching: how Magento's caching layers work and how to use them correctly in Hyvä.
- View Model Cache Tags: enabling proper cache invalidation for view models.
Recommended configuration
These settings require no code changes and have the highest performance impact relative to the effort involved. They are the foundation for everything else in this chapter.
Enable Varnish full page cache
Magento's built-in full page cache works, but Varnish dramatically reduces Time to First Byte by serving cached responses without hitting PHP at all. On a warm cache, responses under 200ms are common.
Enable it in the Magento admin under Stores → Configuration → Advanced → System → Full Page Cache → Caching Application.
For cache tag invalidation and ESI support to work correctly, follow the Magento Varnish configuration guide.
Configure Redis for cache and session storage
File-based cache is the default and is fine for development, but Redis is significantly faster under production load. Configure it for both the default cache and session storage.
See the Magento Redis configuration guide for setup instructions.