> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.weltpixel.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to speed up your Magento 2 store and increase performance

There are multiple ways to optimize your Magento 2 store for speed and performance. Ideally, combine as many of the items below as possible.

**Note:** If you’re using our [Pearl Theme for Magento 2](https://www.weltpixel.com/magento-2-theme-pearl), see this companion guide: [How to speed up your Magento 2 store with the Pearl Theme](https://www.weltpixel.com/blog/post/how-to-speed-up-your-magento-2-store-with-the-pearl-theme).

---

## 1) Enable All Magento Caches
Path: `System → Cache Management → Select All → Enable → Submit`

![](https://storage.crisp.chat/users/helpdesk/website/-/8/2/f/7/82f777db9598a80/653e69a8-860c-4beb-8ad2-307815_io6ylu.png)

---

## 2) Enable GZIP Compression (Apache)

Edit the **`.htaccess`** file in your web root and add the following.  
*(Shown as plain text—copy/paste as-is.)*

    ## Enable Apache file compression
    SetOutputFilter DEFLATE
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    Header append Vary User-Agent env=!dont-vary

**Enable far-future Expires headers:**

    ExpiresActive On
    ExpiresDefault "access plus 1 year"

**Disable ETags in clustered setups:**

    FileETag none

**Dynamic content (PHP) alternative:** create a `.user.ini` in your document root with:

    zlib.output_compression = on

> ℹ️ Note: Some LiteSpeed environments ignore the Apache `.htaccess` directives above.

---

## 3) Enable CSS/JS Minification & Merging
Path: `Stores → Configuration → Advanced → Developer → JavaScript Settings / CSS Settings`

![](https://storage.crisp.chat/users/helpdesk/website/-/5/8/2/f/582fb4e2f5d18c00/3968fef6-59ed-406f-b4e6-b15f01_1l44heo.png)

**Tip:** Test before/after with [WebPageTest](https://www.webpagetest.org). JS bundling can sometimes increase *Start Render* or *DOM Content Loaded* times.

---

## 4) Move JS to Bottom, Preload CSS & Use Advanced Bundling
The [Magento 2 Speed Optimization & Advanced JS Bundling module](https://www.weltpixel.com/magento-2-speed-optimization-advanced-js-bundling.html) helps by:
* Implementing optimized bundles
* Moving JS to page bottom
* Preloading critical CSS

Case study: [Disable unused Pearl modules & enable Advanced JS Bundling](https://support.weltpixel.com/hc/en-us/articles/360007965373-Improve-Magento-store-speed-Disable-unused-Pearl-Theme-extensions-and-Design-Elements-implement-Advanced-JS-Bundling).

---

## 5) Optimize Images
* Use web-sized assets (e.g., `1920×1080` for hero banners, not `5760×3240`).
* Compress losslessly with tools like [TinyPNG](https://tinypng.com/) or [WebSitePlanet](https://www.websiteplanet.com/webtools/imagecompressor/).
* Many CDNs auto-compress images.

---

## 6) Enable Flat Categories & Products
Path: `Stores → Configuration → Catalog → Catalog → Storefront`

![](https://storage.crisp.chat/users/helpdesk/website/-/6/0/f/8/60f80c5884affc/ccb48a6c-9d1b-47fa-834e-f9589e_ou1un5.png)

---

## 7) Switch to Production Mode
Run:

`php bin/magento deploy:mode:set production`

Reference: [How to set Magento 2 Developer and Production Mode via SSH](https://support.weltpixel.com/hc/en-us/articles/115004436368-How-to-set-Magento-2-Developer-and-Production-Mode-via-SSH)

---

##  8)  Enable Backend Caching (Redis/Memcached)
Use Redis or Memcached per your host’s Magento-optimized setup.  
More: [Choosing the right Magento 2 hosting](https://support.weltpixel.com/hc/en-us/articles/115004433688-Choosing-the-right-Magento-2-hosting).

---

## 9) Use Varnish Cache
Preferred over the built-in full-page cache:  
[Magento Varnish setup docs](http://devdocs.magento.com/guides/v2.0/config-guide/varnish/config-varnish.html)

---

## 10) Lazy-Load Images
Use [WeltPixel Lazy Load (free)](https://www.weltpixel.com/magento-2-lazy-load-product-extension.html) to load images as they enter the viewport.

---

## 11) Use a CDN
CDNs improve speed, security and bandwidth efficiency. Example provider: [Section.io](http://section.io/) (with Varnish integration).

---

## 12) Prefer HTTP/2 (over HTTPS)
HTTP/2 allows multiplexed, parallel requests over one connection. Ensure:
* Your site is served over **HTTPS**
* Your host supports **HTTP/2**

![](https://storage.crisp.chat/users/helpdesk/website/-/7/c/5/1/7c5142b3f2572c00/95d68c31-1481-44c6-908f-d36063_u71r1l.png)
![](https://storage.crisp.chat/users/helpdesk/website/-/7/a/6/e/7a6e0fdcf9b5d400/d13b5559-66a4-4153-ad70-55fba9_1j4ourm.png)

---

## 13) Keep Magento & Extensions Updated
Regular updates include performance and security fixes.  
* Check the [Pearl Theme change log](https://www.weltpixel.com/resources/PearlTheme/User-Guide-WeltPixel-Pearl-Theme-Magento2.html#change-log).  
* Confirm 3rd-party extension compatibility before upgrading.

---

## 14) Avoid Extension Conflicts
Multiple vendors can introduce class rewrite conflicts that hurt performance.  
WeltPixel extensions include a debugger to highlight rewrites:

![](https://storage.crisp.chat/users/helpdesk/website/-/a/f/c/8/afc8117c0d119800/5dc6227e-6d4b-428e-ae79-6f6fab_bybgne.png)

If conflicts are hard to resolve, consider the [Pearl Theme](https://www.weltpixel.com/magento-2-theme-pearl), which bundles 10+ compatible extensions (GTM, Quick View, Banner Slider, etc.).

---

## Related Resources
* [Improve Magento store speed: Disable unused Pearl Theme extensions](https://help.weltpixel.com/en/article/improve-magento-store-speed-disable-unused-pearl-theme-extensions-and-design-elements-implement-advanced-js-bundling-1976m5j/?bust=1758094331949)  
* [How to speed up your Magento 2 store with the Pearl Theme](https://www.weltpixel.com/blog/post/how-to-speed-up-your-magento-2-store-with-the-pearl-theme)