Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to utilize Magento caching while using "Magento APIs"

The way I am using Magento is like this:

  • We are using Magento admin/dashboard to setup store, catalog and related stuff
  • We are using Magento's SOAP & RPC API interface for our customer facing storefront i.e. listing store, catalog, products, purchase, reviews etc in our UI layer is done by calling various Magento APIs.

What we have noticed that our customer facing storefront is pretty slow since Magento SOAP & RPC API are taking pretty long time to return the data even with the sample data that comes with Magento download. Even after we have enabled all the available caching in Magento admin panel we noticed that Magento is sending every query to the MySQL database and those queries tend to slow whole thing down under constant heavy load.

So I was wondering whether I have setup everything right or missed something? I repeat here we are not using Magento UI but have our own remote UI layer built using Java EE, Spring MVC etc that communicates with Magento using its SOAP & RPC API interface.

Is there some other form of caching to be enabled for these API calls? And how to avoid database calls from Magento using some sort of caching support?

like image 447
anubhava Avatar asked Mar 06 '12 17:03

anubhava


People also ask

How do I enable Magento cache?

Enable/Disable Cache Types In your Magento backend, go to System > Tools > Cache Management. Check the box on which cache type you want to enable/disable. Then on the top left corner, select the appropriate action (Enable/Disable) and click the Submit button.

How does Magento cache work?

Magento collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the file system and database. Clean or flush this cache type after modifying configuration files.

Where is Magento cache stored?

Magento 2 cache is in the var/cache directory off the store root with the settings located under System -> Cache Management. Configuration – generally, the system collects configuration info from all module/config.


1 Answers

Magento use configuration (XML) cache in API as well in normal frontend access. The cost of retrieve the data from MySQL using API is the same than use the frontend access. There is no native API response cache yet, just XMLs and MySQL Query Cache. You have to add a proxy or anything else by your own.

In my humble opinion, receive cached data will be painful, you can get late and mismatching data. I'll start with a good MySQL and HTTP Server performance tunning like is described in http://info.magento.com/rs/magentocommerce/images/Magento_PerformanceWhitepaper-EEv1-9.1.pdf.

like image 89
Rafael Kassner Avatar answered Oct 07 '22 11:10

Rafael Kassner