Skip to content

Added caching layer

Compare
Choose a tag to compare
@demianh demianh released this 19 Jun 11:35
· 50 commits to master since this release

The FileCache lets you cache API requests. It does check which objects have changed and only fetches the changed objects.

This is how you can use the FileCache layer:

// create a cache object
$client = new Webling\API\Client('https://demo.webling.ch','MY_APIKEY')
$cache = new FileCache($client, [
    'directory' => './webling_cache'
]);

// get object
$cache->getObject('member', 506);

// get root objects
$cache->getObject('membergroup');

// check for updates and renew cache
$cache->updateCache();

// clear the whole cache
$cache->clearCache();