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(2w ago)012↑150%Apache-2.0PHPPHP &gt;=8.0

Since Mar 9Pushed 2w 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 today

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

39

—

LowBetter than 87% of packages

Maintenance97

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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

14d 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

[cache/adapter-common

Common classes for PSR-6 adapters

11024.1M37](/packages/cache-adapter-common)[cache/cache

Library of all the php-cache adapters

2712.7M20](/packages/cache-cache)[laminas/laminas-cache

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

1066.7M111](/packages/laminas-laminas-cache)[cache/filesystem-adapter

A PSR-6 cache implementation using filesystem. This implementation supports tags

725.7M76](/packages/cache-filesystem-adapter)[cache/array-adapter

A PSR-6 cache implementation using a php array. This implementation supports tags

568.2M141](/packages/cache-array-adapter)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

563.8M27](/packages/cache-redis-adapter)

PHPackages © 2026

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