Adobe Commerce: Strategies for Infrastructure Transformation & Efficient Operations

blog adobe-commerce-strategies-for-infrastructure-transformation

Adobe Commerce: Strategies for Infrastructure Transformation & Efficient Operations

`blog adobe-commerce-strategies

Written by Manpreet Kaur

Content Writer

June 13, 2023

Powered by AI and cutting-edge technology, Adobe Commerce Cloud helps businesses transform their B2B and B2C commerce experiences with personalized, seamless end-to-end solutions that offer unmatched flexibility, extensibility, and scalability. Read further to discover strategies to enhance your Adobe Commerce infrastructure by optimizing configurations, improving backend settings, and planning for scalability.

DNS Lookup

DNS lookup links domain names with their respective IP addresses. Web browsers wait for DNS lookup completion and provide the IP address. Therefore, reducing DNS lookup time directly contributes to faster overall page load times.

Network Bandwidth

It is imperative to have adequate network bandwidth to ensure seamless data exchange between web nodes, databases, and caching/session servers. You can use servers such as Redis to exchange data to improve caching for high performance. Ensure you have an effective network channel between web nodes and the caching server to reduce obstructions during read/write operations.

Content Delivery Network (CDN)

Integrate a CDN such as Fastly to improve asset downloading performance. Adding a CDN layer is beneficial if you have an on-premises implementation of Adobe Commerce Cloud.

PHP-FPM Settings

  • ByteCode: Activate and configure the opcache module to obtain high speed out of Adobe Commerce on PHP 7.
  • APCU: Activate the PHP APCu extension and configure Composer to improve performance.
  • Realpath_cacheconfiguration: Optimizing realpath_cache to enable PHP processes to cache file paths.

Web Server

Configure the nginx.conf.sample configuration file to use nginx as a web server for high performance. Install PHP-FPM with TCP, activate HTTP/2 and Gzip, and optimize worker connections.

Session Caching

Adequate capacity should be allocated to hold caches in memory for maximum performance. Determine the amount of memory needed to configure using block cache as it grows according to the number of web pages on a website.

Database

Optimize the innodb_buffer_pool_instances configuration to prevent problems with multiple threads trying to obtain the same instance. Ensure the value of the max_connections argument correlates with the maximum number of PHP threads configured on the application server.

Also, Adobe Commerce offers several scalability advantages, including using three separate master databases for different functional areas of Magento application. In addition, the split database configuration improves your system performance tremendously and reduces server operational costs.

For more information visit Revert from Split Database.

Varnish for Full-Page Caching

Install Varnish for full-page cache on Adobe Commerce Cloud. The integrated full-page caching is slow compared to Varnish; therefore, using Varnish increases HTTP traffic.
Follow the below steps to configure Adobe Commerce to use Varnish by logging into Adobe Commerce Admin:

  • Click Stores > Configuration > Advanced > System > Full Page Cache.
  • Click Varnish Caching from the Caching Application List.
  • Input a value in TTL for public content field.
  • Enter the details of Varnish Configuration.
blog varnish-for-full-page-caching

You can easily break the full-page cache in Adobe Commerce. If you want to omit a block from the cache, avoid using the attribute cacheable=”false” in the XML layout during block declaration. This disables cache for the whole page that contains the specific block, not only for that block.

Search the cacheable=”false” attribute in the layout and find out on which blocks they are set and on which pages those blocks are called. This helps identify if trivial pages have issues with cache. It is possible to test manually if your page is cached or not. Place the store in Developer Mode on your local or stage environment.

Clearing Adobe Commerce Cache

  • Load the page in web browser.
  • Check page headers in browser’s debug network tab.
  • Search for X-Adobe Commerce-Cache-Debug: MISS
  • Refresh the page; it should change to HIT. If not, it implies the page is not cached.

Enabling Production Mode

  • CLI command to see the current mode: php bin/Adobe Commerce deploy:mode:show
  • CLI command to switch to production mode: php bin/Adobe Commerce deploy:mode:set production
  • CLI command to switch to developer mode is: php bin/Adobe Commerce deploy:mode:set developer

Message Queues

The Message Queue Framework enables a module to display messages in queues and specifies consumers that get messages. It supports RabbitMQ, which enables sending and receiving messages.

Optimize Product Images

Product images should balance quality and size perfectly to load seamlessly across the screen. Avoid using outdated methods that force your server to download images during page loading. Magento’s lazy loading technique defers image loading until your page is fully loaded or your user scrolls through your catalog.

Elasticsearch

Elasticsearch offers full-text searching and quick web content search capability as indexing runs on the web server. This results in high-speed search results and catalog pages.

  • Click Stores > Settings > Configuration > Catalog> Catalog > Catalog Search.
  • From the Search Engine list, click Elasticsearch or Elasticsearch 5.0+, as shown in the figure. (Elasticsearch 5.0+ option is not available for Adobe Commerce 2.1.)
blog elasticsearch

Advanced JS Bundling

Advanced JS Bundling reduces the HTTP requests to the server and reduces the size of JS files. It minimizes the need to load all bundles for web pages the web browser requests. Enable advanced JS bundling to define bundles by page types or purposes by following the below steps:

  • Set Adobe Commerce on production mode.
  • Click Stores > Configuration > Advanced > Developer.
  • Set Minify Javascript Files option to Yes.
  • Save Config.
  • Flush Cache at System > Cache Management page.
blog advanced-js-bundling

Flat Tables

Adobe Commerce uses the EAV (Entity Attribute Value) Model that stores attributes of its entities in multiple tables based on the type of their values. Therefore, to retrieve data, you need to use multiple tables, joins, and requests, which slow the speed of queries.

Adobe Commerce offers flat tables for catalogs and products. They can be created by combining all attributes of an entity into one table. You need to query one table to request data, which makes it fast. To enable flat tables, log into Adobe Commerce Admin as an administrator and follow these steps:

  • Click Stores > Configuration > Catalog > Catalog > Storefront.
  • Select Yes for Use Flat Catalog Category.
  • Select Yes for Use Flat Catalog Product.
  • Save Config.

Setting Indexers to “Update on Schedule”

When you set indexers to “Update on Save,” each time you save a product, attribute, or category, a specific index starts running. This may result in higher resource consumption and eventually slow down your server. Therefore, it is recommended to set the indexers to “Update on Schedule.” This ensures that they are executed by the cron job at the specified time (Set the time when your website has low traffic).

blog update-on-schedule

Cronjob Setting

blog cronjob-setting

GZIP Compression

It allows the servers to compress files that can be easily transferred over networks. Follow the below steps:

  • Turn on gzip compression.
  • Activate the mod_deflate Apache module by updating your .htaccess file
  • Uncomment the appropriate lines as shown below in the code snippet.
  • mod_deflate module compresses static resources into smaller files before transferring them to the browser.


<ifmodule mod_deflate.c="">
############################################ ## enable apache served files compression # Insert filter on all content SetOutputFilter DEFLATE # Insert filter on selected content types only AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json image/svg+xml # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don’t compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don’t deliver the wrong content Header append Vary User-Agent env=!dont-vary
  <IfModule >

Remove Unnecessary Ajax Calls

Use the DevTools in Chrome to check the Ajax calls. Right-click on the page and click Inspect. Next, navigate the Network tab and filter the request by XHR. Here, you’ll see all the Ajax requests on the page and truncate unnecessary ones.

Sample configuration you can add to app/etc/env.php


'session' => array ( 'save' => 'redis', 'redis' => array ( 'host' => '127.0.0.1', 'port' => '6379', 'password' => '', 'timeout' => '2.5', 'persistent_identifier' => '', 'database' => '2', 'compression_threshold' => '2048', 'compression_library' => 'gzip', 'log_level' => '1', 'max_concurrency' => '6', 'break_after_frontend' => '5', 'break_after_adminhtml' => '30', 'first_lifetime' => '600', 'bot_first_lifetime' => '60', 'bot_lifetime' => '7200', 'disable_locking' => '0', 'min_lifetime' => '60', 'max_lifetime' => '2592000' ) ),

You can setup Redis by using the command line. For the default cache, run the command:


php bin/Adobe Commerce setup:config:set – cache-backend=redis – cache-backend-redis-=...

Specify parameters that are specific to Redis default caching. Run the below command for page cache.


php bin/Adobe Commerce setup:config:set – page-cache=redis – page-cache-redis-server=redis.example.com – page-cache-redis-db=

Conclusion

Royal Cyber will help you to unlock the full potential of your Adobe Commerce project. Our certified experts understand the best practices and ensure their implementation while creating new websites, upgrades, or expanding your existing Adobe platform. We apply the right techniques to optimize performance such that your website is always ranked in the top search results.

Want to Enhance your Adobe Commerce Website's Performance?

Recent Blogs

  • How to Write Test Cases: Introduction and Best Practices
    Learn to write effective test cases. Master best practices, templates, and tips to enhance software …
    Read More »
  • MuleSoft Admin Co-Pilot: Revolutionize Integration Management
    In today’s fast-paced digital landscape, seamless data integration is crucial for business
    Read More »
  • Revolutionizing Customer Support with Salesforce Einstein GPT for Service Cloud
    Harness the power of AI with Salesforce Einstein GPT for Service Cloud. Unlock innovative ways …
    Read More »