ZF-4745: Add ability to cache Zend_Json_Server definitions between requests


Add the ability to cache both Zend_Json_Server SMD and server definitions between requests.


Added Zend_Json_Server_Cache to trunk; same API as Zend_XmlRpc_Server_Cache.

Changing issues in preparation for the 1.7.0 release.

Is it possible that the caching does not cache the return type? When I get an SMD in the browser, using a GET request and sample code from the manual, I get the return type right the first time. But on all subsequent requests, I get null as the return type. This happens even after a system crash. Only if I modify the class file that was attached to the server, then the SMD will be correct, again only for one request, on subsequent requests, the return type is null again.

I suppose it's possible -- look through the generated SMD cache and check to see if the return is in there. If not, add a test, and let's fix it. :)

I do not know this component very well: where can I find the generated SMD cache?

You pass a Zend_Json_Server instance to Zend_Json_Server_Cache::saveSmd($file, $server). Typically, you'd then grab the SMD from the cache using Zend_Json_Server_Cache::getSmd($file) on subsequent requests, returning it directly to the client. You can therefore check the file generated to see if it contains return information.

Thanks for the update!

I did do nothing to cache the SMD explicitly. From your explanation I understand there is no default cache. This makes the behavior even stranger, I wonder if it is specific to certain version of OS and or php. Would anyone else have observerd this?