1 You can claim that your soap server uses gzip compression for http content, as well as the output of your site. Rounding 0.7 s to SF seems a bit long, or the webservice is responding for a long time, or there is an important latency of work. If you can, try other hosting companies for your Belgian server, in France some of them got a much better connection with the USA than others. I was faced with moving the website from one site to another, and the latency between Paris and New York almost doubled! it is huge and my client with a lot of American visitors was unhappy with this. The decision to move the web server to SF may be an option, you will get much better communication between the servers, but be careful with a delay if your visitors are mainly located in Europe.
2 You can use the mecanism of the operation code cache, for example xcache or APC. This will not change the latency of the soap, but will improve the php runtime.
3 Depending on whether the soap request is repetitive and how long the content update can be extended, you can give it a real improvement by using the cache for soap results. I suggest you use a memory caching system (e.g. xcache / memcached or something else) because they are much faster than files or a database caching system.
From your class, the createclient method is not the most adapted functionality for caching, but for any read operation, this is the best way for perf:
private function _createClient() { $xcache_key = 'clientcache' if (!xcache_isset($key)) { $ttl = 3600; //one hour cache lifetime $client = $this->_getClient(); ///private method embedding your soap request xcache_set($xcache_key, $client, $ttl); return $client; } //return result form mem cache return xcache_get($xcache_key); }
An example for the xcache extension, but you can use other systems in a very similar way.
4 To continue, you can use similar mecanism to cache your php processing results (for example, outputting template rendering and other subsequent operations). The key to success in this technique is that you know exactly which part is cached and how long it will remain without problems.
source share