Saturday, June 28, 2025
News PouroverAI
Visit PourOver.AI
No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
News PouroverAI
No Result
View All Result

7 Easy Ways to Make a Magento 2 Website Faster — SitePoint

April 17, 2024
in Cloud & Programming
Reading Time: 3 mins read
0 0
A A
0
Share on FacebookShare on Twitter


Magento 2 is a popular ecommerce platform. One of the complaints I hear is that it’s slow. Site owners can face slow catalog pages and unresponsive checkouts. The reasons behind poor performance vary from misconfiguration to too many third-party extensions. In this article, I’ll present seven practical tips for ensuring that your Magento 2 online store is able to run faster.

  1. Use Varnish as a Caching Application
  2. Varnish is a HTTP proxy that can cache content. You can install it in front of a web server and increase the site’s performance. (You can visit the Varnish website here. Magento 2 has built-in support for Varnish. To turn it on, you need to do two things: Go to an admin panel menu > Stores > Configuration > Advanced > System > Full Page Cache and set Caching Application to Varnish Cache. Then expand the Varnish Configuration tab and export a VCL file. Pass this file to your system administrator or a hosting support team. They will use that file to configure Varnish daemon.

  3. Install a Cache Warmer
  4. Magento 2 implements full page cache (FPC) to have low server response time. FPC works in a way that the first request is slow and all the next requests are fast. A cache warmer is a script (or extension) that makes those first requests. It fills up cache storage so that users can enjoy low time to the first byte (TTFB). You can install a cache warmer as a Magento 2 module. There are commercial ones and a free one available. Or, you could create a simple PHP script. It will warm all categories and a list with the most popular pages:

  5. Move JavaScript to the Bottom of the Page
  6. Moving JavaScript to the page bottom will improve the first contentful paint speed metric. Magento 2.4+ has a special admin setting for it. You can run the command line: php bin/magento config:set dev/js/move_script_to_bottom 1 Then flush the cache: php bin/magento cache:flush Now Magento will move JavaScript to the bottom.

  7. Convert Images to WebP Format
  8. WebP images take less disk space than JPEGs and PNGs. If we can convert a site’s pictures to WebP, we can lower page weight and improve performance. Using a special cwebp command line utility you can convert an image to WebP: cwebp -q 80 image.png image.webp the -q switch sets a quality range. (In our case it’s 80.) There are several Magento 2 modules that can do this conversion. Adobe Commerce Marketplace is a great place to find those extensions.

  9. Turn HTML Minification On
  10. HTML minification helps reduce page weight and improve speed. Magento 2.4+ can minify HTML with no extra modules. To turn it on you need to run the following command: php bin/magento config:set dev/template/minify_html 1 Then you’ll need to recompile to actually create minified templates: php bin/magento deploy:mode:set production

  11. Compress and Merge JavaScript and CSS
  12. Compressing and merging JS and CSS files helps reduce page weight. It also lowers HTTP requests and makes the site faster. To turn on merging and compressing, run the following commands: php bin/magento config:set dev/js/merge_files 1 php bin/magento config:set dev/css/merge_css_files 1 php bin/magento config:set dev/js/minify_files 1 php bin/magento config:set dev/css/minify_files 1 Then recompile: php bin/magento deploy:mode:set production And it should be working.

  13. Cache ElasticSearch Query Results
  14. Magento 2.4+ uses the ElasticSearch engine for indexing and catalog management. To speed up ElasticSearch performance with bigger catalogs you can cache query results. Open the vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php file and add the following around line 365: @@ -365,6 +365,9 @@ class Connection implements ConnectionInterface $params ); + if(strpos($uri,'search') !== FALSE){ $params['request_cache'] = 'true'; } $uri .= '?' . http_build_query($params); } It will turn on the internal ElasticSearch query cache mechanism.

Conclusion

In this article, I’ve presented seven ways to speed up Magento 2 website: use Varnish as full page cache, set up a cache warmer, defer JavaScript loading, convert all images to WebP, turn HTML minification on, compress and merge JS and CSS files, and cache ElasticSearch Query Results. These steps will improve server response time and Core Web Vitals. If you have any questions or comments, don’t hesitate to ask!



Source link

Tags: EasyfasterMagentoSitePointWaysWebsite
Previous Post

Researchers taught robots to run. Now they’re teaching them to walk

Next Post

Bernstein Advises Buying Bitcoin Miners’ Stocks Ahead of Halving

Related Posts

Top 20 Javascript Libraries You Should Know in 2024
Cloud & Programming

Top 20 Javascript Libraries You Should Know in 2024

June 10, 2024
Simplify risk and compliance assessments with the new common control library in AWS Audit Manager
Cloud & Programming

Simplify risk and compliance assessments with the new common control library in AWS Audit Manager

June 6, 2024
Simplify Regular Expressions with RegExpBuilderJS
Cloud & Programming

Simplify Regular Expressions with RegExpBuilderJS

June 6, 2024
How to learn data visualization to accelerate your career
Cloud & Programming

How to learn data visualization to accelerate your career

June 6, 2024
BitTitan Announces Seasoned Tech Leader Aaron Wadsworth as General Manager
Cloud & Programming

BitTitan Announces Seasoned Tech Leader Aaron Wadsworth as General Manager

June 6, 2024
Copilot Studio turns to AI-powered workflows
Cloud & Programming

Copilot Studio turns to AI-powered workflows

June 6, 2024
Next Post
Bernstein Advises Buying Bitcoin Miners’ Stocks Ahead of Halving

Bernstein Advises Buying Bitcoin Miners' Stocks Ahead of Halving

How to become an AI engineer

How to become an AI engineer

OpenAI’s Assistants API gets a boost

OpenAI's Assistants API gets a boost

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest
23 Plagiarism Facts and Statistics to Analyze Latest Trends

23 Plagiarism Facts and Statistics to Analyze Latest Trends

June 4, 2024
How ‘Chain of Thought’ Makes Transformers Smarter

How ‘Chain of Thought’ Makes Transformers Smarter

May 13, 2024
Amazon’s Bedrock and Titan Generative AI Services Enter General Availability

Amazon’s Bedrock and Titan Generative AI Services Enter General Availability

October 2, 2023
Is C.AI Down? Here Is What To Do Now

Is C.AI Down? Here Is What To Do Now

January 10, 2024
The Importance of Choosing a Reliable Affiliate Network and Why Olavivo is Your Ideal Partner

The Importance of Choosing a Reliable Affiliate Network and Why Olavivo is Your Ideal Partner

October 30, 2023
Managing PDFs in Node.js with pdf-lib

Managing PDFs in Node.js with pdf-lib

November 16, 2023
Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

June 10, 2024
AI Compared: Which Assistant Is the Best?

AI Compared: Which Assistant Is the Best?

June 10, 2024
How insurance companies can use synthetic data to fight bias

How insurance companies can use synthetic data to fight bias

June 10, 2024
5 SLA metrics you should be monitoring

5 SLA metrics you should be monitoring

June 10, 2024
From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

June 10, 2024
UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

June 10, 2024
Facebook Twitter LinkedIn Pinterest RSS
News PouroverAI

The latest news and updates about the AI Technology and Latest Tech Updates around the world... PouroverAI keeps you in the loop.

CATEGORIES

  • AI Technology
  • Automation
  • Blockchain
  • Business
  • Cloud & Programming
  • Data Science & ML
  • Digital Marketing
  • Front-Tech
  • Uncategorized

SITEMAP

  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2023 PouroverAI News.
PouroverAI News

No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing

Copyright © 2023 PouroverAI News.
PouroverAI News

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In