This module replaces MSP_APIBoost., (*1)
composer require msp/apienhancer php bin/magento setup:upgrade
NOTE: If you are using Varnish see below, (*2)
Varnish users should read below, (*3)
While using Magento 2 REST API for decoupled frontend (e.g.: a ReactJS or AngularJS frontends), you need to access catalog, search and products., (*4)
Every time you perform a REST API call, no matter if you have a FPC configured or not, Magento will compute your request as it was the first one., (*5)
With this simple module you will be able to cache API REST requests and get up to a 50x performance boost., (*6)
In order to correctly handle cache invalidation and contents variation you should apply small variations to your varnish VCL file., (*7)
Add the following code to your Varnish configuration file at the beginning of vcl_hash section:, (*8)
hash_data(regsub(std.tolower(req.http.Authorization), "^bearer\s\x22(\w+?):\w+?\x22", "\1"));
, (*9)
Implementation example:, (*10)
``` import std ... sub vcl_hash { hash_data(regsub(std.tolower(req.http.Authorization), "^bearer\s\x22(\w+?):\w+?\x22", "\1")); ... } ..., (*11)