Magento 2 category page speed optimization: 9 Best practices

In the competitive world of eCommerce, fast-loading category pages are vital for capturing and keeping shoppers’ attention. Magento 2 stores with sluggish category pages risk losing potential customers due to slow load times, which can lead to higher bounce rates and lower conversions. Optimizing category page speed not only improves user experience but also enhances SEO performance, helping your store rank higher in search results. This post explores 9 best practices for speeding up Magento 2 category pages, ensuring a smoother, faster shopping experience for your customers.

1. Optimize images efficiently to accelerate category page loading

Images often make up the largest portion of a Magento 2 category page’s load size. Heavy, uncompressed, or improperly optimized images can drastically slow down page loading times. Slow pages frustrate users, increase bounce rates, and harm your SEO rankings. Optimizing images is crucial to delivering a fast, smooth shopping experience and improving your store’s visibility on search engines.

Resize and compress images before uploading

Large images significantly increase page load times, so resizing images to the exact dimensions required on the category page is essential to avoid unnecessarily large files. Proper compression further reduces file size without sacrificing visual quality, ensuring your Magento 2 category pages load quickly and smoothly.

How to do it:

+ Using Magento 2's built-in configuration to resize images: Magento 2 provides a way to limit the maximum dimensions. This ensures that when you upload images, Magento will resize them down if they exceed these limits.

Go to Stores > Configuration > Advanced > System > Images Upload Configuration.

Set Max Width and Max Height for images to the desired pixel values matching your category page design.

Note: Magento’s built-in resizing only adjusts dimensions but does not compress file size or optimize images.

+ Using external tools for resizing and compression: For best results, resize and compress images before uploading to Magento using specialized tools such as:

Photoshop: Use “Export As” or “Save for Web” to resize and optimize images.

TinyPNG or TinyJPG: Online tools that compress images effectively while maintaining quality.

ImageOptim or Squoosh: Desktop or web apps to resize and compress images in bulk.

Need to manage product images efficiently? Explore how to import bulk product images to Magento and streamline your store’s image management.

Use a consistent image format

Using multiple image formats like JPEG, PNG, GIF, or SVG results in inconsistent file sizes and complicates image compression workflows. Therefore, maintaining consistent image formats across your Magento 2 category pages improves performance and simplifies optimization. You should standardize on a single efficient format, preferably WebP, to ensure faster page loading and easier image management.

How to do it:

+ Convert all images to a single format before uploading: Convert product and category images to a consistent format like WebP before uploading. This uniformity helps control file sizes and loading speeds across the site. Use tools such as Squoosh, Photoshop (with WebP plugin), or online converters for batch conversions.

+ Keep fallbacks for browser compatibility: Not all browsers fully support WebP yet. To maintain compatibility, store JPEG or PNG fallback versions alongside WebP images. Your Magento setup or CDN can then serve the appropriate format based on browser support, ensuring all users see images correctly without compromising speed.

+ Use extensions to automate conversion of existing images: For stores with large existing image libraries, manually converting all images can be tedious. Magento 2 extensions that automatically convert uploaded images to WebP format and serve the correct version to browsers can save time and effort. These extensions also handle fallback delivery seamlessly, improving site performance with minimal manual work.

Ready to simplify image optimization and boost your category page speed?

To easily convert and serve WebP images on your Magento 2 store without hassle, consider the WebP Image Extension from BSS Commerce - a trusted Magento 2 extension provider. It automates image optimization and ensures your site delivers fast-loading, high-quality visuals. Visit site today to learn more!

Implement lazy loading

Without lazy loading, all images on a category page load immediately when the page is requested, causing longer wait times and higher data transfer. Lazy loading prioritizes visible content first, speeding up time-to-interactive and enhancing user experience, which can also boost SEO performance.

Magento 2 does not support native lazy loading for product images or media assets out of the box, including in the latest versions. To enable lazy loading, you need to install a Magento 2 extension designed specifically for this purpose. These extensions automatically add the necessary loading="lazy" attributes or implement JavaScript-based lazy loading for product images and other media on category pages.

2. Minify and bundle CSS and JavaScript

CSS and JavaScript files are essential for styling and interactivity on Magento 2 category pages, but excessive or unoptimized files can increase page load time by generating multiple HTTP requests and large downloads. Merging (bundling) files reduces the number of requests, while minification removes unnecessary characters, lowering file size. Additionally, deferring or asynchronously loading non-critical JavaScript ensures essential content loads first, improving perceived speed and user experience.

How to do it in Magento 2:

Merge CSS and JavaScript Files:

Go to Stores > Configuration > Advanced > Developer > JavaScript Settings and CSS Settings.

Enable Merge JavaScript files and Merge CSS files to combine multiple files into fewer bundles, reducing the number of HTTP requests.

Minify CSS and JavaScript:

In the same configuration area, enable Minify JavaScript Files and Minify CSS Files to remove spaces, comments, and unnecessary code, shrinking file sizes for faster downloads.

Defer or async load non-essential JavaScript:

Magento 2 does not provide built-in settings for deferring or asynchronously loading JavaScript by default.

You can achieve this by customizing your theme or using extensions that add defer or async attributes to script tags, ensuring non-critical scripts load after the main content.

3. Leverage Magento caching

Full Page Cache (FPC) delivers entire rendered pages instantly, while Varnish cache offers a powerful, high-performance HTTP accelerator. Configuring block and layout caching ensures dynamic page elements are efficiently cached and updated only when necessary.

How to do It in Magento 2:

Enable Full Page Cache (FPC):

Navigate to Stores > Configuration > Advanced > System > Full Page Cache.

Set Caching Application to Built-in Cache (default)

This enables Magento to serve cached versions of category pages instantly to visitors.

+ Use Varnish Cache Integration:

Install and configure Varnish as a reverse proxy for Magento 2 to improve caching speed and reduce backend load.

In Magento Admin, under Full Page Cache settings, select Varnish Cache and configure appropriate TTL (time to live) values and purge settings.

Ensure your server and network setup supports Varnish for best results.

Properly configure block and layout caching:

Use Magento’s built-in block caching to cache static page sections like layered navigation and product lists.

Avoid disabling caching for blocks unless necessary.

For custom themes or modules, make sure dynamic blocks implement proper cache keys and lifetimes.

4. Streamline Magento category page content

Category pages overloaded with too many products, filters, and heavy content increase page size and complexity, causing slower load times and poorer user experience. By limiting the number of products displayed per page and simplifying layered navigation, you reduce server processing and client rendering time. Minimizing static blocks and unnecessary CMS content also cuts down on extra HTML, improving speed and clarity.

How to do It in Magento 2:

+ Limit products per page:

Go to Stores > Configuration > Catalog > Catalog > Storefront.

Adjust the Products per Page on Grid Allowed Values and Products per Page on Grid Default Value to a reasonable number like 20 or 30.

Fewer products per page means less data to load and faster rendering.

Minimize layered navigation filters and attributes:

Limit the number of attributes used as filters in layered navigation via Stores > Attributes > Product.

Disable or remove rarely used filters to simplify the navigation panel and reduce query complexity.

For better performance and UX, consider using extensions like BSS Commerce Magento 2 Layered Navigation. This extension offers AJAX-based filtering that loads filters dynamically without reloading the whole page, reducing server requests and speeding up category page interactions.

+ Avoid heavy static blocks and unnecessary CMS content:

Review category page static blocks and CMS content to remove or simplify large images, videos, or bulky HTML.

Use lightweight, minimal content that supports the category without adding excessive load.

5. Use Content Delivery Network (CDN) to speed up asset delivery

Serving static files and media assets like images, CSS, and JavaScript through a CDN significantly reduces the load on your Magento 2 server and decreases latency by delivering content from servers closer to your users. This results in faster page loads, improved reliability, and better scalability, especially for stores with global audiences.

How to do it in Magento 2:

Choose a reliable CDN provider: Select a CDN service that supports Magento, such as Cloudflare, Fastly, Amazon CloudFront, or others. Here are critical CDN features for Magento 2 category page speed optimization that you need to consider when choosing:

Global network of edge servers: Ensures fast content delivery by serving assets from servers closest to your users.

HTTPS/SSL support: Protects user data and improves SEO with secure, encrypted connections.

Fast content caching and purging: Enables quick loading and easy updates by efficiently caching static files and allowing instant cache clearing.

High availability and reliability: Provides uninterrupted service with redundant infrastructure and failover systems.

DDoS protection and security features: Shields your store from traffic spikes and malicious attacks.

Easy integration with Magento 2: Offers clear setup guides or plugins for smooth CDN implementation.

Configure Magento to use the CDN:

In Magento Admin, go to Stores > Configuration > Web > Base URLs (Secure & Unsecure).

Update the Base URL for Static View Files and Base URL for User Media Files with your CDN URL (e.g., https://cdn.yourdomain.com/).

Verify and test CDN integration:

Clear Magento caches and deploy static content if needed.

Test your frontend to confirm assets are served via the CDN URL and loading speeds have improved.

6. Optimize the database and indexing

Magento 2 relies heavily on database queries to load category pages, especially when retrieving product lists and layered navigation data. Slow or inefficient database operations can cause delays in page rendering. Using Flat Catalog reduces complex joins by flattening product and category data into simpler tables, speeding up queries. Regular reindexing ensures Magento’s data is up-to-date and optimized for fast retrieval. Cleaning and optimizing database tables helps maintain overall database performance and reduces bloat.

How to do it in Magento 2:

+ Enable flat catalog for products and categories: This flattens product and category data into simpler tables, improving query speed for category pages.

Go to Stores > Configuration > Catalog > Catalog > Storefront.

Set Use Flat Catalog Category and Use Flat Catalog Product to Yes.

Regularly reindex Magento data:

Use Magento CLI commands (bin/magento indexer:reindex) regularly to reindex data such as product prices, inventory, and categories.

Alternatively, set indexers to Update by Schedule under System > Index Management to automate the process.

Proper indexing ensures Magento uses the latest optimized data for faster page loads.

Clean and optimize database tables:

Regularly clean logs, sessions, and temporary data to reduce the overall size of the database, which improves its efficiency. You can also apply database optimization tools or extensions to defragment and optimize tables related to categories and products. These actions help reduce query execution time and maintain database responsiveness, leading to faster loading of Magento 2 category pages.

7. Utilize advanced server and search optimization

Optimizing server and search configurations plays a critical role in accelerating Magento 2 category pages. ElasticSearch offers fast and efficient product filtering and search, enhancing user experience. Enabling HTTP/2 and Brotli compression reduces the size and improves the loading speed of assets. Using Redis for session and cache storage significantly boosts data retrieval speed compared to default storage methods.

How to do it in Magento 2:

+ Use ElasticSearch for fast filtering and searching:

Magento 2 supports ElasticSearch natively from version 2.4 onwards.

Configure ElasticSearch via Stores > Configuration > Catalog > Catalog Search.

Set the ElasticSearch server details and enable it to improve search and layered navigation speed.

+ Enable HTTP/2 and Brotli compression on the server:

Work with your hosting provider or server admin to enable HTTP/2 protocol, which allows multiplexing and faster loading of resources.

Enable Brotli compression, which often outperforms gzip in reducing file sizes for CSS, JS, and HTML.

Use Redis for session and cache storage:

Configure Redis for session storage and cache backend in app/etc/env.php or via Magento admin cache settings.

Redis reduces latency and speeds up data access compared to file-based or database storage.

9. Monitor and continuously improve Magento 2 category page performance

Regular monitoring helps identify bottlenecks and measure the effectiveness of optimization efforts. Keeping Magento and extensions updated ensures you benefit from performance improvements and security patches.

+ Regularly test category page speed:

Use tools like Google PageSpeed Insights, GTmetrix, or WebPageTest to analyze load times and get actionable suggestions.

Monitor metrics such as Largest Contentful Paint (LCP), Time to Interactive (TTI), and Total Blocking Time (TBT).

Update Magento and Extensions for performance patches:

Stay current with Magento releases and apply updates promptly.

Update third-party extensions regularly to incorporate bug fixes and speed improvements.

Looking to boost engagement on product pages? Visit our blog post Improve customer experience on Magento product page for actionable tips to enhance usability and sales.

Conclusion

A fast-loading category page is crucial for retaining visitors and enhancing their shopping experience on your Magento 2 store. Speed improvements not only reduce bounce rates but also contribute positively to your search engine rankings and overall business performance. Continuous attention to performance and proactive optimization will help you maintain a competitive edge in today’s fast-paced eCommerce environment. Prioritize speed as a core part of your Magento strategy to ensure lasting success and customer satisfaction.

Magento 2 Extensions by BSS Commerce

Magento 2 Extensions | Best Adobe Commerce Plugins