PHPackages                             limingxinleo/swoft-entity-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. limingxinleo/swoft-entity-cache

ActiveLibrary[Caching](/categories/caching)

limingxinleo/swoft-entity-cache
===============================

Swoft 模型实体缓存

1.3.5(7y ago)91.6k1MITPHPPHP &gt;=7.0

Since Jul 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/limingxinleo/swoft-entity-cache)[ Packagist](https://packagist.org/packages/limingxinleo/swoft-entity-cache)[ RSS](/packages/limingxinleo-swoft-entity-cache/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (12)Used By (1)

swoft-entity-cache
==================

[](#swoft-entity-cache)

Swoft 模型实体缓存

[![Build Status](https://camo.githubusercontent.com/dd768149d673fd5d5fe8577756bca9bd284012300640e35d2699d9267586c2f9/68747470733a2f2f7472617669732d63692e6f72672f6c696d696e6778696e6c656f2f73776f66742d656e746974792d63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/limingxinleo/swoft-entity-cache)

环境变量
----

[](#环境变量)

```
# 实体缓存超时时间
ENTITY_CACHE_TTL=3600
# 模型缓存前缀
ENTITY_PREFIX=prefix
```

使用
--

[](#使用)

config/properties/app.php中增加对应自定义组件

```
return [
    ...
    'components' => [
        'custom' => [
            'Swoftx\\Db\\Entity\\',
        ],
    ],
];

```

修改实体基类，增加ModelCacheable Trait

```
