Browsed by
Tag: Optimize

How to cache Magento collection query results

How to cache Magento collection query results

Introduction Today, I would like to introduce “How to cache the Magento collection result” without customizing the PHP code. When you have worked with the Magento collection, you would like to consider if you can cache the result for the next time if the data aren’t generally updated by admin or 3rd tools. By default, Magento support saves the result of the collection to cache but it is not enabled by default, we have to add some custom to di.xml…

Read More Read More

Magento 2 Critical CSS and Core Web Vital Optimization

Magento 2 Critical CSS and Core Web Vital Optimization

Google requires the Core Web Vitals score for getting better on SEO. Web Vitals is an initiative by Google to provide unified guidance for quality signals that are essential to delivering a great user experience on the web. With Magento 2 Critical CSS and Core Web Vital optimization module we provides some ways to optimize CWV values and implement criticalcss.com service and some Core Web Vital optimization to your Magento 2 project. We built a service that allows generating the…

Read More Read More

How to create a custom message queue in Magento 2

How to create a custom message queue in Magento 2

We know that Magento 2 supports consumer and MessageQueue by default (MQF). The Message Queue Framework (MQF) is a system that allows a module to publish messages to queues. It also defines the consumers that will receive the messages asynchronously. Example, after save the order, you have to send a notification to the customer (In this case, we temporary forget the feature asynchronous email, and forcus to the process that could asynchronously) The following diagram illustrates the Message Queue Framework In…

Read More Read More

Integration Elasticsearch On Magento 2 Community (CE)

Integration Elasticsearch On Magento 2 Community (CE)

Magento 2 Open Source (CE) does not provide integration with Elasticsearch by default, but we have other choices for this case there are Elasticsearch is built-in – Magento 2.3.4 Magento 2 Free Module: Elasticsuite from Smile-SA => https://github.com/Smile-SA/elasticsuite/ Elasticsearch Free Service cloud: https://bonsai.io Now let we are going to Install Elasticsearch extension and config Elasticsearch extension with Bonsai Elasticsearch cloud Step 1: Create an account in https://bonsai.io and create your first Cluster. After all you will have an Access URL like this: https://[username]:[password]@[application-code].ap-southeast-2.bonsaisearch.net Step 2: Let login to the…

Read More Read More

Magento 2 – PHP Optimize Tips – Part 2

Magento 2 – PHP Optimize Tips – Part 2

Continue of Part 1. After part 1 you know how to process with large Collection, why we need to use Model Factory instead of Model in __constructor and Customer data sections to load a partition of the web page without disabling FULL page cache. Today I will provide you with consultation and assist you with some tips when you’re working on data. Tip 1: Use in condition instead of for each id and load Data Model You have an array…

Read More Read More

Magento 2 PHP Optimize Tips – Part 1

Magento 2 PHP Optimize Tips – Part 1

Magento 2 PHP Optimize Tips:There are many ways to optimize Magento 2. However, the first thing you should do is optimizing your codes before touching to DB or Cache. Tip 1: Using Factory in the constructor. Why did I say that? Because of the case very simple of Dependence Injection design working in Magento 2 => _constructor, __constructor … will be called, it’s very bad if in the constructor or default functions call for each Collection.=> If your classes are Factory the…

Read More Read More