Question

I have created some custom rest api's and using Magento's default rest api's.

I want to reduce the loading time of the api, as I have custom api's too so the request time and response time is quite more than usual.

Is there any way or solution to this scenario. that will be a great help.

Thanks in advance.

Était-ce utile?

La solution

kindly follow these steps while developing:

  • do not use addAttributeToSelect(*), only select attributes which you need.
  • do not use ObjectManager
  • Use the Magento\Framework\Data\Collection class to retrieve a collection of filtered objects instead of directly querying the database.
  • Avoid creating helper classes
  • use caching practice in GET API calls
  • to boost your APIs you can use the following module: https://github.com/magespecialist/m2-MSP_APIEnhancer
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top