PHPackages                             cryjkd/model-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. cryjkd/model-cache

ActiveLibrary[Caching](/categories/caching)

cryjkd/model-cache
==================

A simple model cache

v1.0.2(9mo ago)17MITPHPPHP &gt;=8.1

Since Sep 15Pushed 7mo agoCompare

[ Source](https://github.com/cryjkd/model-cache)[ Packagist](https://packagist.org/packages/cryjkd/model-cache)[ RSS](/packages/cryjkd-model-cache/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (7)Versions (4)Used By (0)

ModelCache
----------

[](#modelcache)

```
一个简单的hyperf框架的模型缓存.
二级缓存, redis与上下文

```

安装
--

[](#安装)

```
composer require cryjkd/model-cache

```

配置
--

[](#配置)

```
php bin/hyperf.php vendor:publish cryjkd/model-cache

```

```
return [
    'redis_select' => 'default',		//redis的名称
    'null_ttl' => 3600				    //数据库数据为空时,redis的过期时间
];

```

模型
--

[](#模型)

更换模型的继承类, 更换成 `Cryjkd\ModelCache\BaseModel`

```
