Performance is measured on my 8 core 20GB RAM machine. When measuring I’m using 6x CPU throttle and slow 3G. In network tab check “Disable cache”. Enable https and http2 on local using devcert.

My nginx conf looks like following

server {
listen 80;
server_name m24.to;
set $MAGE_ROOT /var/www/m24;
set $MAGE_DEBUG_SHOW_ARGS 1;
include /var/www/m24/nginx.conf;
}
server {
listen 443 ssl http2;
server_name m24.to;
set $MAGE_ROOT /var/www/m24;
set $MAGE_DEBUG_SHOW_ARGS 1;
ssl_certificate /var/www/m24/m24.to.cert;
ssl_certificate_key /var/www/m24/m24.to.key;
include /var/www/m24/nginx.conf;
}

Case 1 : Turn off bundling,merging

Case 2 : Performance using Magepack

Case 3 : Improved Javascript bundling

Using jakhotiya/magento-improved-bundling

In following case you see improvement in LCP by using move script to bottom option

--

--

This is about using Magento 2 internal classes useful for building restapi client in your magento extension.

\Magento\Framework\Oauth\Oauth

Oauth class will help you deal with REST authorization. Interesting function is `buildAuthorizationHeader` . Of course you should inject \Magento\Framework\Oauth\OauthInterface in your code instead of the class.

\Magento\Framework\Serialize\Serializer\Json

For building valid json bodies.

\Magento\Framework\Reflection\DataObjectProcessor

If you want to convert an object like order to array use.

--

--