PHPackages                             reaway/think-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. reaway/think-cache

ActiveLibrary[Caching](/categories/caching)

reaway/think-cache
==================

think cache

v8.0.0(3mo ago)016↓90.9%Apache-2.0PHPPHP &gt;=8.0

Since Mar 9Pushed 3mo agoCompare

[ Source](https://github.com/reaway/think-cache)[ Packagist](https://packagist.org/packages/reaway/think-cache)[ Docs](https://github.com/reaway/think-cache)[ RSS](/packages/reaway-think-cache/feed)WikiDiscussions main Synced 2w ago

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

think-cache
===========

[](#think-cache)

安装
--

[](#安装)

```
composer require reaway/think-cache
```

用法
--

[](#用法)

```
use Think\Component\Cache\Facade\CacheFacade;

require __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

CacheFacade::setConfig([
    'default' => 'file',
    'stores' => [
        'file' => [
            'type' => 'File',
            // 缓存保存目录
            'path' => __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
            // 缓存前缀
            'prefix' => '',
            // 缓存有效期 0表示永久缓存
            'expire' => 0,
        ],
        'redis' => [
            'type' => 'redis',
            'host' => '127.0.0.1',
            'port' => 6379,
            'prefix' => '',
            'expire' => 0,
        ],
    ],
]);

CacheFacade::set('key', 'value');
CacheFacade::get('key');
```

文档
--

[](#文档)

详细参考 [缓存处理](https://www.kancloud.cn/manual/thinkphp6_0/1037634)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance80

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

106d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d342ebe348631bdfbe41ebcd414f0b5fa2334027d413e3543afb301f3503a13f?d=identicon)[reaway](/maintainers/reaway)

---

Top Contributors

[![reaway](https://avatars.githubusercontent.com/u/60423559?v=4)](https://github.com/reaway "reaway (1 commits)")

### Embed Badge

![Health badge](/badges/reaway-think-cache/health.svg)

```
[![Health](https://phpackages.com/badges/reaway-think-cache/health.svg)](https://phpackages.com/packages/reaway-think-cache)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k239.9k75](/packages/moonshine-moonshine)[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1067.2M145](/packages/laminas-laminas-cache)[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M4](/packages/sabre-cache)[voku/simple-cache

Simple Cache library

322.6M9](/packages/voku-simple-cache)[graham-campbell/bounded-cache

A Bounded TTL PSR-16 Cache Implementation

112.1M10](/packages/graham-campbell-bounded-cache)[neos/cache

Neos Cache Framework

102.1M36](/packages/neos-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
