且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento的SOAP V1 V2与性能

更新时间:2022-12-14 14:39:20

有很多原因WSDL请求可能会花费很长的时间,但我会检查的第一件事是在 WSDL 设置STRONG>缓存。当你进行API调用到Magento的,Magento的使用PHP的 SoapServer的对象。在 SoapServer的对象需要获取自己的WSDL文件进行操作,而产生这个文件的获取可能是一个耗费时间的事情。

There's lots of reasons a WSDL request might be taking a long time, but the first thing I'd check is the settings for the WSDL cache. When you make an API call into Magento, Magento uses PHP's SoapServer object. The SoapServer object needs to fetch its own WSDL file to operate, and the generation and fetching of this file can be a time consuming thing.

System -> Configuration -> Magento Core API -> General Settings

和寻找启用缓存WSDL。设置为yes,你会看到一些API的性能改进。

and look for "Enable WSDL Cache". Set this to yes and you'll see some API performance improvement.

这设置可能无法在你的Magento版本存在 - 如果是这样的话,你可能会感兴趣的水星API 一个>扩展(由我创建并销售)与API改进,包括此功能,旧版本的Magento。如果你没有预算延期, Mage_Api_Model_Server_Adapter_Soap 是旧版本的Magento禁用此缓存的类。

This setting may not exist in your version of Magento — if that's the case you might be interested in the Mercury API extension, (created and sold by me) with API improvements that include this functionality for older versions of Magento. If you don't have budget for an extension, Mage_Api_Model_Server_Adapter_Soap is the class where older versions of Magento disable this cache.