MENU
HowTo

MAGENTO 2で構築されたサイトのスピードアップするためのヒント

MAGENTO 2で構築されたサイトのスピードアップするためのヒント

Magento 2は、現在では人気のあるEコマースプラットフォームです。
これは、より多くの新機能とより複雑なeコマースイノベーションに対応するものであり、大規模なソースコードを使用しています。

Magento 2の優れた機能と柔軟性には代償としてスピードが低速になる可能性があります。
本記事ではMagento 2のウェブサイトをスピードアップするためのヒントについていくつかご紹介したいと思います。

M2 websiteのスピードアップするための7つのヒント

-サーバーとシステムの要件

-最新のMagento2バージョンへの更新

-コンテンツデリバリーネットワークの使用

-ワニスキャッシュ有効化

-CSS / Javascriptミニファイ有効化

-画像を最適化する

-Memcachedを構成する。

1.サーバーとシステムの要件

サーバーとシステムは、最も重要な要素として考えられます。
それらを最適化することで、Magento 2のウェブサイトの速度を上げることができます。

サーバーの要件:Magento 2は、大規模で複雑なソースコードを備えた強力なプラットフォームであるため、M2 website を共有ホスティングではなく専用ホスティングまたはVPSホスティングでホストすることをお勧めします。

システム要件:以下のURLで参照してください。

https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

2.最新のMagento2バージョンへの更新

M2 websiteのスピードアップの簡単な方法の1つは、Magento2バージョンを更新することです。 Magento 2は、新しいバージョンをリリースするたびに、パフォーマンスやその他の調整を改善します。
※ただし使用しているエクステンションが利用できなくなったりコンフリクトを起こして他の機能に影響を与えるかもしれません。あくまで自己責任でお願いします。

3.コンテンツデリバリーネットワーク(CDN)の使用

コンテンツデリバリーネットワークサービスを使用して、コンテンツを顧客に迅速に配信し、ユーザーエクスペリエンスを向上させます。

Cloudflareというサービスをご存じの方が多いとは思いますが、CDNプロバイダーの中で人気のある選択肢の1つです。
トラフィック量レベルに基づいてさまざまな価格帯が与えられているAWSCloudfrontと呼ばれるAmazonWebServices独自のサービスも御座います。

4.Varnish Cache有効化

サーバーの負荷を最小限に抑え、ウェブサイトの速度が向上します。
さまざまなキャッシュが御座いますが、Varnish Cacheが良い選択だと思います。
Varnish Cacheを有効にすると、Magento2のストア全体が高速になります。

M2でのVarnish Cacheのインストールと構成の詳細については下記をご参照ください。

https://devdocs.magento.com/guides/v2.4/config-guide/varnish/config-varnish.html

5. CSS / Javascriptミニファイ有効化

JavascriptとCSSアセットも、M2 websiteの速度を低下させる原因です。
Magento 2は、JavascriptファイルとCSSファイルをマージして縮小する方法を提供しています。

この機能を有効にする手順は次の通りです。

Javascriptをマージして縮小する:

  • 管理パネルで、[ストア]> [設定]> [構成]に移動する
  • [詳細]を展開し、[開発者]を選択する。
  • [JavaScript設定]のタブをドロップダウンする。
  • Merge JavaScript FilesMinify JavaScript Filesを有効にする。
    Javascript設定イメージJavascript設定イメージ

CSSをマージして縮小する:

  • 管理パネルで、[ストア]> [設定]> [構成]に移動する。
  • [詳細]を展開し、[開発者]を選択する。
  • [CSS設定]のタブをドロップダウンする。
  • Merge CSS FilesMinify CSS Filesを有効にする
    CSS設定イメージCSS設定イメージ

6.画像を最適化する

画像の最適化は、ウェブサイトの速度を上げるための最良のソリューションでもあります。 Magento 2のウェブサイトでは、パフォーマンスを少なくとも40%向上させることができます。

エクステンションを使用して画像のファイルサイズを縮小するか、OptiPNG、PngQuant、ZopfliPNG、JPEGOptimなどのツールを使用して画像のサイズを変更して圧縮することができます。
これにより、ウェブサイトが高速になるだけでなく、サーバー上での読み込み時間と過負荷も軽減されます。

Cloudflare ProのようなクラウドCDNを使用している場合、画像はCloudfare proによって最適化されているため、最適化の必要は御座いません。

7. Memcachedを構成する

もう1つの方法は、データベースの負荷を減らすことです。それを行うのに、無料でオープンソースの分散メモリオブジェクトキャッシングシステムであるMemcachedで構成することで実現します。

結論

パフォーマンスはEコマースウェブサイトにとって最も重要な問題です。そのため、Magento 2のウェブサイトを強化して、売り上げを伸ばしましょう。Eコマースビジネスについてサポートが必要な場合は、お問い合わせください。


 

Magento 2 is a popular eCommerce platform nowadays. It comes as a new era of e-commerce innovation with more new features and more complex and has large source code also. Magento 2’s superior feature and flexibility come with a price, Magento 2 can be slow . Today, I give you some tips to speed up your Magento 2 website. Now let dive into it.

7 tips to speed up your M2 website

–Server and System Requirements

–Update to latest Magento 2 version

–Use a Content Delivery Network.

–Enable Varnish Cache.

–Enable CSS / Javascript Minification

–Optimize Images

–Configure Memcached

1. Server and System Requirements

Server and System can be resider as two most important factor. By optimizing them can help you increase the speed of the Magento 2 website.

Server requirements: Magento 2 is a powerful platform with large and complex source code, so I recommend you host your M2 website to a Dedicated Hosting or VPS Hosting instead of Shared Hosting.

System requirements: you can reference here

https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

2.Update to latest Magento 2 version

One of the methods that is a simple way to speed up your M2 website is updating Magento 2 version. Magento 2 will improve performance and other tweaks whenever it releases a new version.

3.Use a Content Delivery Network.

Using a Content Delivery Network service to deliver content faster to Customers for a better user experience.

Cloudflare is one popular choice among CDN providers, but you may also consider Amazon Web Services ‘ own offering known as AWS Cloudfront if that better suits your needs are given its different pricing tiers based on traffic volume levels

4.Enable Varnish Cache

Minimizing server load helps to improve website speed. Caching can help you achieve this. Varnish Cache is a good choice. Enabling varnish cache makes your Magento 2 store speedy .

More detail about Install and Configuration the Varnish Cache in M2 you can reference here:

https://devdocs.magento.com/guides/v2.4/config-guide/varnish/config-varnish.html

5.Enable CSS / Javascript Minification

Javascript and CSS assets are also the culprit to make your M2 website slow. Magento 2 offers you a method to merge and minify Javascript and CSS files

Here are steps to enable this feature:

Merge and Minify Javascript

  • Admin Panel, go to Stores > Settings > Configuration .
  • Expand Advanced and select Developer .
  • Drop down the JavaScript Settings tab.
  • Enable Merge JavaScript Files and Minify JavaScript Files .
Javascript SettingsJavascript Settings

 

Merge and Minify CSS

  • Admin Panel, go to Stores > Settings > Configuration .
  • Expand Advanced and select Developer .
  • Drop down the CSS Settings tab.
  • Enable Merge CSS Files and Minify CSS Files
CSS SettingsCSS Settings

 

6.Optimize Images

Optimize images is also the best solution to increase your website speed. Magento 2 website can give at least 40% boost in performance.

You can use an extension to reduce the file size of your images or simply resize them yourself and compress them using tools like OptiPNG, PngQuant, ZopfliPNG, JPEGOptim, etc. This will not only make your website fast but will also reduce load time and overload on your server.

If you are using a cloud CDN like Cloudflare Pro, optimization is not an issue because your image has been optimized by Cloudfare pro for you; so there’s no need to worry about it!

7.Configure Memcached

Another method is decreasing the database load. And the way to do it is to configure Memcached which is a free and open-source distributed memory object caching system.

Conclusion

Performance is the most important issue for an eCommerce Website. Therefore let boost your Magento 2 website to increase your sales. Please contact us if you need help with your eCommerce business.

 

 

弊社ではMagento2を利用した多機能ECサイトの構築・越境EC/中国越境ECの開発をして企業様をサポートしています。 ご興味ある方は是非問い合わせください。

IT導入補助金2023対象ツールで越境EC(中国含む)・国内向けECを制作できます。
ABOUT ME
Hoa HT
ベトナム出身でホーチミン市に住んでいます。現在、マルウェブ会社でMagentoデベロッパーとして活躍しています。

※注意

本ブログの投稿内容に関するお問い合わせをして頂いてもご返信できませんので、何卒ご了承ください。