PHPackages                             kylin987/think-orm-redis-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. kylin987/think-orm-redis-cache

ActiveLibrary[Caching](/categories/caching)

kylin987/think-orm-redis-cache
==============================

基于think-orm和redis开发的跨项目共享cache

v1.2.6(1y ago)073↓100%MITPHPPHP &gt;=7.1

Since Apr 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kylin987/think-orm-redis-cache)[ Packagist](https://packagist.org/packages/kylin987/think-orm-redis-cache)[ RSS](/packages/kylin987-think-orm-redis-cache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (0)

基于thinkphp6的跨项目共享数据缓存的composer包
===============================

[](#基于thinkphp6的跨项目共享数据缓存的composer包)

此包仅适用于thinkphp6和thinkphp8框架使用，同时提供适用于webman的包[点这里](https://github.com/kylin987/webman-thinkorm-redis-cache)

安装
--

[](#安装)

```
composer require kylin987/think-orm-redis-cache

```

使用
--

[](#使用)

### 1、引入：

[](#1引入)

```
参考test/model/User.php和Mini.php文件

```

### 2、配置：

[](#2配置)

```
1、修改config/database.php，添加以下3个配置

//数据库缓存store
    'cache_store'       => 'ormCache',
    //缓存时间
    'cache_exptime' => 172800,
    //空数据是否仍然缓存
    'cache_always' => true,

2、修改config/cache.php，增加一个缓存store，名字ormCache和上面的配置保持一致，下面的配置根据需求自行配置

// ormredis缓存
'ormCache'  =>  [
    // 驱动方式
    'type'   => 'redis',
    // 服务器地址
    'host'   => env('cache.redis_host','127.0.0.1'),
    //端口
    'port'   => env('cache.redis_port','6379'),
    //密码
    'password' => env('cache.redis_password',123456),
    //
    'select' => 5,
],

```

### 2、使用：

[](#2使用)

```
//获取数据
$id = 10;
$user = User::getRedisCache($id);

//更新数据
//正常使用模型更新数据即可，也可以手动清理缓存触发后续的更新缓存
$id = 10;
$user = User::getRedisCache($id);
User::delCache($user);

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Every ~42 days

Recently: every ~86 days

Total

14

Last Release

569d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f1c0726daff91d74835f3ef3901923fdf7b6b0b65d919968682b53edd22c9cc?d=identicon)[kylin987](/maintainers/kylin987)

---

Top Contributors

[![kylin987](https://avatars.githubusercontent.com/u/26080774?v=4)](https://github.com/kylin987 "kylin987 (14 commits)")

### Embed Badge

![Health badge](/badges/kylin987-think-orm-redis-cache/health.svg)

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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