Cookies setting

Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy

Cookie Policy
Essential cookies

These cookies are strictly necessary for the site to work and may not be disabled.

Information
Always enabled
Advertising cookies

Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.

Information
Analytics cookies

Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.

Information
mageplaza.com

8 Effective Ways to Enhance Magento 2 Page Speed

Vinh Jacker | 03-17-2025 8 Effective Ways to Enhance Magento 2 Page Speed - Mageplaza

Your storefront can sit on a perfectly tuned server and still feel slow. Everything that happens after the first byte — images, JavaScript, fonts, layout — is a separate problem with separate fixes, and it is the half Google measures with Core Web Vitals.

Magento 2 can be slow out of the box. It ships more code and more flexibility than most stores ever use, and the default theme loads a great deal that a given page never needs.

This guide covers eight frontend changes that move LCP, INP and CLS, how to measure each one, and which of them you can do from the admin today. One check before you start: if your server response time is above 600ms, no frontend work will rescue it. Fix server and backend performance.

Why page speed matters for your Magento store

Speed is the first thing a shopper judges you on, and they judge before a single product is visible. Four things follow from it:

  • Conversions: Slow pages lose buyers at every step, and the loss compounds across category, product and checkout.
  • Bounce rate: A shopper who leaves before the page renders never sees the price, the reviews, or the offer you paid to put in front of them.
  • Rankings: Google uses Core Web Vitals as a ranking signal. It is not the strongest one, but it breaks ties between comparable results — and it is one of the few signals you fully control.
  • Crawl budget: Slow responses mean Googlebot fetches fewer URLs per visit. On a large catalogue, that is products sitting unindexed for weeks.

Ignore the “three second rule” you have read elsewhere — Google never set it. The published thresholds are LCP under 2.5s, INP under 200ms and CLS under 0.1, and those are what your report is graded against.

Get Website Performance Audit

Check the Magento Page Speed

Measuring site speed is the first step in evaluating its severity and determining the source of the issue. Your team needs to run speed tests frequently as part of the maintenance process to improve and speed up Magento.

The three numbers that matter

Your PageSpeed score is a summary, not a target. Google ranks on three Core Web Vitals, and each one has a different cause — which is why the fixes below are grouped by the metric they move.

Metric What it measures Good Usually caused by
LCP How long until the main content appears under 2.5s Oversized images, render-blocking CSS, slow server
INP How fast the page responds when tapped or clicked under 200ms Heavy JavaScript, third-party scripts
CLS How much the layout jumps while loading under 0.1 Images and banners without reserved space

INP replaced First Input Delay in March 2024. If your reporting still shows FID, it is out of date. PageSpeed Insights shows you lab data from a simulated device, and field data from real Chrome users over the last 28 days. Google ranks on the field data. Fix the lab score, then wait — the field data takes weeks to catch up.

We suggest some trustworthy tools for testing your website:

Google PageSpeed Insights

Google PageSpeed Insights is a free tool that helps you measure and improve the speed and performance of your web pages. It works by fetching and analyzing your web pages from both mobile and desktop devices and giving you a score between 0 and 100 for each device type.

This tool divides your Magento performance into 3 levels with 3 different colors.

  • Green (good score): 90–100

  • Orange (average): 50–89

  • Red (poor): 0–49

Using Google PageSpeed Insights

A higher score indicates that your web page is well-optimized for speed and efficiency.

The tool also provides you with suggestions on how to improve your web page speed based on the following categories:

  • Opportunities: It provides suggestions that can help you reduce your web page’s loading time, such as eliminating render-blocking resources, compressing images, or using browser caching. The tool estimates how much faster your web page can load if you implement these suggestions.

  • Diagnostics: This tool can help you improve the quality and user experience of your web page by using responsive design, avoiding redirects, or minimizing the main thread work. The tool does not estimate the impact of these suggestions on your web page speed, but they are still important to consider.

  • Passed audits: These aspects of your web page are already optimized for speed and performance and do not require any further action.

GTMetrix

GTMetrix

Nevertheless, Magento performance issues can only occur under real-world conditions with substantial traffic and user interactions. Recognizing this, Magento suggests New Relic as a website performance monitoring tool for merchants.

Through an intuitive dashboard, New Relic offers multifaceted insights, enabling real-time monitoring of transactional performance, server queries, error incidence, and historical data for comprehensive analysis.

New Relic is also a user-friendly tool that is very useful for eCommerce sites that have many extensions and POS using the same Magento backend. By selecting Magento extensions and POS that are compatible with New Relic, you can track how your website performance and speed are affected. Therefore, you can identify the exact extension or action that makes your Magento website slower.

Why is it Challenging to Speed Up Your Magento 2 Site?

Why is it Challenging to Speed Up Your Magento 2 Site?
Why is it Challenging to Speed Up Your Magento 2 Site?

Apparently, if speed optimization in Magento 2 stores was just adding and enabling extensions, you wouldn’t be finding yourself tired with performance optimization. It’s much more complex than that.

Many variables

You need to take into consideration the different variables involved in page speed assessment. Your page speed could be terrific in the ideal condition if the user’s device can render everything you put at it. Or it could be that your page speed is not that terrible, but the perceived performance for the user is bad because of cumulative layout shifts.

There are plenty of variables to be taken into account when enhancing your store performance which is why you should always find out the specific problems first.

Trade-off

As you really get into it, speed optimization is a continuous trade-off between performance and functionality - you always have to sacrifice a few things to get greater performance. Sometimes it’s a stunning Magento theme; sometimes, it’s an awesome extension that is harmful performance-wise to your store.

Priority

Even if you finished your homework and discovered all the existing problems your store has, it still wouldn’t be a great idea to try fixing them. Micro optimizations hardly do things to boost real-world performance. Hence, you should only focus on optimizing the problems that you think are the serious hindrances stopping your store from delivering the kind of shopping experience you want.

8 Effective Methods to Improve Magento 2 Page Speed

How to Improve Page Speed in Magento 2?
How to Improve Page Speed in Magento 2?

1. Optimize your Magento product images

For an eCommerce retail store, your website will have many product images. These images can enhance your website’s visual appeal and engagement, but if they are not optimized properly, they can also slow down your page speed and performance.

Therefore, you should optimize your Magento image to reduce the size and improve the quality of your images. Magento image optimization can help you save bandwidth, storage space, and loading time, as well as improve your user experience and SEO ranking.

To do Magento image optimization, you can use the following methods:

  • Choose the right image format: You should select the image format that is suitable for your image type and purpose. For example, you can use JPEG for photos, PNG for logos and icons, and WebP for modern browsers.
  • Compress the image size: You should compress the image size to remove any unnecessary data and reduce the file size. You can use tools such as TinyPNG, ImageOptim, or Kraken.io to compress your images without losing quality.
  • Resize the image dimensions: You should resize the image dimensions to match the display size on your website. You can use tools such as Photoshop, GIMP, or Pixlr to resize your images according to your website layout and design.
  • Use lazy loading: You should use lazy loading to defer the loading of images that are not in the initial viewport. This can improve your page speed and performance by reducing the number of requests and resources that your website has to load.

WebP files are typically 25–35% smaller than the equivalent JPEG or PNG at the same visual quality, and every modern browser supports the format. Converting a whole catalogue by hand is not realistic — the Magento 2 WebP Image Optimizer compresses and converts in bulk, runs on cron for anything uploaded later, and keeps the originals as a fallback. Get the dimensions right too: see the recommended Magento 2 image sizes for what each image role should actually be.

2. Fix render-blocking CSS & preload the hero image

When operating a Magento store, there will be many times that you or your developers work alot with CSS & JavaScript. You can try minifying the CSS/ JavaScript or merge these files to speed up your website.

Go to the backend of the site, then navigate to Configuration > Developer > JavaScript Settings

Enable CSS & JavaScript minification
Enable CSS & JavaScript minification

When reaching the JavaScript settings, you search for the setting that says “Minify JavaScript Files,” and you will see a drop-down menu. Choose the Yes option.

Now, go to the CSS settings. Under the Merge CSS Files and Minify CSS files options, choose Yes.

Enable CSS & JavaScript minification
Enable CSS & JavaScript minification

3. Minify your assets — but do not merge or bundle them

Nearly every Magento speed checklist tells you to switch on Merge CSS Files, Merge JavaScript Files and JavaScript Bundling. On a store running today, two of those three will make your INP worse. The advice was correct once. Under HTTP/1.1 a browser would only hold about six connections to your domain, so twenty small files queued behind one another and combining them into one genuinely won. HTTP/2 multiplexes every request over a single connection and that queue no longer exists. What is left is only the cost:

  • You lose cache granularity: Change one line of CSS and every returning visitor re-downloads the whole bundle instead of one small file.
  • You ship code nobody on that page needs: A merged bundle hands the checkout JavaScript to a shopper sitting on your homepage — parsed and executed before they can interact with anything.
  • You delay the first paint: One large render-blocking file has to arrive in full before anything renders. Several small ones do not. Magento’s default JavaScript bundling makes the same trade even more bluntly: it concatenates almost the entire RequireJS tree into a handful of very large files, so every page loads the JavaScript for every other page. This is the single most common cause of a poor INP score on a Luma store. Leave it off. If you need bundling, use a build-time solution that splits per page type — not the checkbox in the admin. Minification is a different matter. It strips whitespace and comments without changing what gets loaded when, so there is no trade-off. Keep it on.

The settings you actually want Go to Stores > Configuration > Advanced > Developer:

Setting Value
Merge CSS Files No
Minify CSS Files Yes
Merge JavaScript Files No
Enable JavaScript Bundling No
Minify JavaScript Files Yes
Minify HTML Yes

If the Developer section is not there, nothing is broken. Magento hides it in production mode. Set the values from the command line instead:

bin/magento config:set dev/css/merge_css_files 0
bin/magento config:set dev/css/minify_files 1
bin/magento config:set dev/js/merge_files 0
bin/magento config:set dev/js/enable_js_bundling 0
bin/magento config:set dev/js/minify_files 1
bin/magento config:set dev/template/minify_html 1
bin/magento setup:static-content:deploy -f
bin/magento cache:flush

Deploy static content on a staging copy first if you can. The command rewrites everything under pub/static, and on a large store with several locales it is not quick.

Then confirm you are actually on HTTP/2 Everything above assumes your server negotiates HTTP/2. If it does not, the reasoning inverts — merging becomes the right call again, and you are optimising the wrong thing entirely. Check it in under a minute. Open your storefront in Chrome, press F12 for DevTools, go to the Network tab and reload. Right-click any column header, enable Protocol, and look at the values:

  • h2 or h3 — you are on HTTP/2 or HTTP/3. The settings above are correct for you.
  • http/1.1 — stop here and talk to your hosting provider. Moving to HTTP/2 is worth more than every checkbox in this section combined, and on most managed Magento hosting it is a support ticket rather than a project. It requires HTTPS, which your store should already have.

How to tell it worked Re-run PageSpeed Insights and watch two diagnostics: Reduce unused JavaScript and Avoid enormous network payloads. Both should drop noticeably once bundling is off. Your total request count will go up — that is expected on HTTP/2, and it is not a problem.

Site Audit Services

Mageplaza offers FREE site health check (15hrs) to help you identify any website flaws & weaknesses and fix them before they start costing you a fortune.

Explore More
Site Audit Services by Mageplaza

4. Cut third-party scripts, not just extensions

“Third-party” means two different problems on a Magento store. Extensions run on your server and slow your response time — that is a backend problem, covered in the server guide linked at the top of this article. Scripts run in your shopper’s browser: tag manager, chat widget, review widget, A/B testing tool, ad pixels. They compete for the same main thread your storefront needs to respond to a tap, and they are the most common reason a store with a healthy server still fails INP. Removing a slow extension will not improve INP. Deferring a chat widget will not improve your server response time. Fix the right one.

The usual offenders

Script The fix
Chat widget Show a static button, load the real widget on click
Tag manager container Delete dead tags; trigger the rest on scroll or interaction
A/B testing tool Limit to the pages under test, never site-wide
Session recording Sample a percentage of traffic, not all of it
Review and social widgets Render server-side, or lazy-load below the fold

Measure before you delete Run PageSpeed Insights and find Reduce the impact of third-party code. It lists every third-party origin with its main-thread blocking time — that is the number that matters for INP, not file size. To settle an argument about a specific vendor: in the DevTools Network tab, right-click its request, choose Block request domain, reload and re-run Lighthouse. Now you have a before and after to show whoever asked for it.

What to do

  • Delete what nobody owns. If no one can name the person who reads the data, remove it.
  • Defer anything not needed for first render — including your tag manager, if it is loading synchronously in <head>.
  • Load heavy widgets on interaction. Most shoppers never open chat and should not pay for it.
  • Gate marketing scripts behind consent. You likely need this for compliance anyway.
  • Re-audit quarterly. Scripts accumulate after every campaign.

Caution: consent management and anti-fraud tools sometimes have to run early. Do not defer a script you do not understand — test on staging and watch the console.

5. Reserve space for images, banners and fonts

CLS is the metric most Magento stores fail without realising it, because it does not show up on a fast connection — you only see it on a real phone on real mobile data. The cause is almost always the same: the browser lays out the page, then something arrives late and pushes everything down. A shopper reaching for Add to Cart taps a banner instead. Three fixes cover most of it:

  • Put width and height back on your image tags. Without them the browser reserves no space and the text below jumps when the image lands. This is the single biggest CLS win on a Luma store.
  • Give promo banners and cookie notices a fixed height container. Anything injected by JavaScript after render needs its space reserved in CSS beforehand.
  • Use font-display: swap and preload your primary font. Otherwise the page paints in a fallback font, then reflows when the real one arrives.

Then verify in PageSpeed Insights — the report highlights exactly which elements shifted.

6. Choose lightweight themes

From impressions only, you can tell since a heavy theme seriously slows down your website, and users with a slow Internet connection and/or old-fashioned hardware capabilities will only be further affected by this.

To solve this problem, you’ll have to selectively pick your Magento themes with concentration put more toward performance. Nevertheless, we understand that it’s difficult to define whether a theme is truly lightweight. This is why you’d better check out whether the demo version of the theme feels rapid to you, and read more user feedback.

7. Go headless with a PWA storefront

As the majority of the Magento sites are still based on the traditional architecture, you’re more confined by the infrastructure since traditional architecture is inflexible, conservative, and apt to slow down gradually.

Magento Headless architecture more or less can address this problem because it is a method that seeks to provide more scalability, flexibility, and more performance advancements to storefronts.

This is the reason why you see brands are choosing PWA storefronts) (which is a headless storefront) as a way to gain more performance improvements. It’s also a sleeper that will win more recognition in the upcoming time.

Read more:

8. Use performance optimization services

If you’re too busy with operating your store and don’t have time to improve your page speed, there are many providers offering Magento Performance Optimization services on the market. One of the most reliable services is Magento 2 website optimization from Mageplaza.

The team works professionally and dedicatedly, providing you excellent technical support and service.

  • Expert analysis: Mageplaza’s experts will work hard to identify your current problems (HTML coding, server, redirects, graphics, etc.
  • Web developers: All the web developers that assist you with page optimization are highly qualified in-house developers.
  • Guaranteed results: You will get calculated enhancement in your rankings, customer satisfaction, and conversion rates.
  • Multi-device optimization: This service will help advance your site performance in every device, including desktops, tablets, and mobiles.

The Bottom Line

With all these above techniques, you can now work to improve your Magento 2 page speed and achieve a better competitive benefit over your competitors.

Nonetheless, you should notice that performance optimization isn’t always valuable since micro-optimizations are usually a wasted effort and remain unchanged in real-world usage. The best strategy is to recognize impactful problems first and concentrate only on them until you obtain the desired results.

Table of content
    Jacker

    Jacker is the Chief Technology Officer (CTO) at Mageplaza, bringing over 10 years of experience in Magento, Shopify, and other eCommerce platforms. With deep technical expertise, he has led numerous successful projects, optimizing and scaling online stores for global brands. Beyond his work in eCommerce development, he is passionate about running and swimming.



    Related Post