Giter VIP home page Giter VIP logo

m2-msp_apienhancer's Introduction

MSP APIEnhancer

This module replaces MSP_APIBoost.

Install procedure

composer require msp/apienhancer
php bin/magento setup:upgrade

NOTE: If you are using Varnish see below

Features

  • Internal cache support
  • Varnish external support (see below)
  • Products and categories automatic invalidation
  • Support for group based catalog rules

Magento2 REST-API features enhancements:

  • FIX: Catalog rules are not applied in REST-API

Varnish users should read below

Why you may need it?

While using Magento 2 REST API for decoupled frontend (e.g.: a ReactJS or AngularJS frontends), you need to access catalog, search and products.

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.

With this simple module you will be able to cache API REST requests and get up to a 50x performance boost.

Important: For Varnish users

In order to correctly handle cache invalidation and contents variation you should apply small variations to your varnish VCL file.

Add the following code to your Varnish configuration file at the beginning of vcl_hash section:

hash_data(regsub(std.tolower(req.http.Authorization), "^bearer\s\x22(\w+?):\w+?\x22", "\1"));

Implementation example:

import std
...
sub vcl_hash {
    hash_data(regsub(std.tolower(req.http.Authorization), "^bearer\s\x22(\w+?):\w+?\x22", "\1"));
    ...
}
...

m2-msp_apienhancer's People

Contributors

phoenix128 avatar slackerzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.