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

ActiveLibrary[Caching](/categories/caching)

sunaloe/cache
=============

1.0.5(6y ago)013MITPHPPHP ^7.1.3

Since May 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aloeproject/sunaloe-cache)[ Packagist](https://packagist.org/packages/sunaloe/cache)[ RSS](/packages/sunaloe-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

概述
--

[](#概述)

laravel 自带的缓存是存在string类型，本扩展包保存到hash类型

运行环境
----

[](#运行环境)

- PHP 7.0
- laravel 5.7
- lumen 5.7

安装方法
----

[](#安装方法)

composer require sunaloe/cache

### lumen

[](#lumen)

- 添加门面方法

```
$app->withFacades(true, [
    \Sunaloe\Cache\Facades\SunaloeCache::class => 'SunaloeCache',
]);
```

- 配置引入 把 sunaloe/cache/config/sunaloe-cache.php 拷贝放到配置目录

```
    $app->configure('sunaloe-cache');
```

- 服务提供者引入

```
    $app->register(\Illuminate\Redis\RedisServiceProvider::class);
   $app->register(\Sunaloe\Cache\CacheServiceProvider::class);
```

使用
--

[](#使用)

```
# == hset hk k4 a
\Sunaloe\Cache\Facades\SunaloeCache::setHkeyPrefix("hk")->forever("k4", "a");

# 如果hash 中hk键k2 不存在 则使用 回调函数的值进行设置
\Sunaloe\Cache\Facades\SunaloeCache::setHkeyPrefix("hk")->remember("k2", 100, function () {
            return ['a' => 1];
  });

# 所有hash key 进行删除
\Sunaloe\Cache\Facades\SunaloeCache::flush()
```

License
-------

[](#license)

- MIT

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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 ~0 days

Total

6

Last Release

2283d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8662167?v=4)[Sun aloe](/maintainers/aloeproject)[@aloeproject](https://github.com/aloeproject)

---

Tags

cachelaravellumen

### Embed Badge

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

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

###  Alternatives

[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M154](/packages/laravel-pulse)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.3M74](/packages/spatie-laravel-responsecache)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M110](/packages/mongodb-laravel-mongodb)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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