ko / json-cache
A caching module for storing data in a JSON file
0.0.6
2018-04-06 03:29 UTC
This package is not auto-updated.
Last update: 2024-12-14 14:11:40 UTC
README
This module is built for caching responses from API's in a file. Its primary focus is on alleviating pressure from an API when data is not required to be up to the second. This is particularly useful when the API may have throttling or rate limiting in use.
Install
composer require ko/json-cache
Properties
Usage
Build the cache settings object
$KOCacheSettings = new \KO\Cache\Settings(); $KOCacheSettings->setValidity(15); $KOCacheSettings->setFile('data_cache.json');
Instantiate a new cache object with the settings
$KOCache = new \KO\Cache\Cache($KOCacheSettings);
Documentation
See the full Documentation for more details.