ko/json-cache
最新稳定版本:0.0.6
Composer 安装命令:
composer require ko/json-cache
包简介
A caching module for storing data in a JSON file
README 文档
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
| Property | Type | Description |
|---|---|---|
| validity | Integer | Number of minutes the cache will be used before being declared invalid [ Default 15 ] |
| file | String | The path of the json cache file [ Default json-cache.json ] |
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.
统计信息
- 总下载量: 110
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-03