Tuesday, April 9, 2019

PHP Toolkit > Improve initial Web Services Performance while Sending First Requests via PHP

When making the first WS request via PHP, the request is usually slower since PHP caches the WSDL on the first request. By default the caching is maintained for 24 hours and so the response time for the requests can be improved by increasing the caching time to more than 24 hours, so that initial request process much faster and in turn not delaying the subsequent requests.

For example, you can increase soap.wsdl_cache_ttl from 24 hours to 1 month by changing its value from 86400 to 2592000.

Please refer to path below, to edit the cache time :

-> Open php.ini and look for below entries :

[soap]
; Enables or disables WSDL caching feature.
; http://php.net/soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1

; Sets the directory name where SOAP extension will put cache files.
; http://php.net/soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://php.net/soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400 (This represents the cache time and can be tried to increase, please put in time in seconds) 

No comments:

Post a Comment