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

ActivePackage[Caching](/categories/caching)

fts/cache-response
==================

laravel 5 response cache

v1.0.3(7y ago)1151MITPHPPHP &gt;=5.4

Since Jul 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fts3232/cache-response)[ Packagist](https://packagist.org/packages/fts/cache-response)[ RSS](/packages/fts-cache-response/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

cache-response
==============

[](#cache-response)

[![Latest Stable Version](https://camo.githubusercontent.com/22984ce25fb744bde3ccb42e192900357a533ea59ba64587a1b45628b744c393/68747470733a2f2f706f7365722e707567782e6f72672f6674732f63616368652d726573706f6e73652f762f737461626c65)](https://packagist.org/packages/fts/cache-response)[![Total Downloads](https://camo.githubusercontent.com/d03c4840f89e737dc5b272b1f4b0fdab978fcaca2fb7fba0dea4ac5a19356f2d/68747470733a2f2f706f7365722e707567782e6f72672f6674732f63616368652d726573706f6e73652f646f776e6c6f616473)](https://packagist.org/packages/fts/cache-response)[![License](https://camo.githubusercontent.com/3baebd8b685ce3f60b5b2bbfe48817148f7cd6f64208a9e2646ef6fbee8ab831/68747470733a2f2f706f7365722e707567782e6f72672f6674732f63616368652d726573706f6e73652f6c6963656e7365)](https://packagist.org/packages/fts/cache-response)

功能
==

[](#功能)

- 生成静态化页面

安装
==

[](#安装)

```
composer require fts/cache-response

```

### 添加服务提供者

[](#添加服务提供者)

打开 `config/app.php` 并添加以下内容到 providers 数组:

```
fts\CacheResponse\CacheResponseServiceProvider.php::class

```

### 中间件

[](#中间件)

打开 `app/Http/Kernel.php` 并添加以下内容到 routeMiddleware 数组:

```
'page-cache' => fts\CacheResponse\Middleware\CacheResponse::class

```

### URL重写

[](#url重写)

- 对于nginx:

    更新`location`块`try_files`内容

    ```
      location = / {
          try_files /static/index.html /index.php?$query_string;
      }

      location / {
          try_files $uri $uri/ /static/$uri.html /index.php?$query_string;
      }

    ```
- 对于apache:

    打开`public\.htaccess` 添加以下内容

    ```
      RewriteCond %{REQUEST_URI} ^/?$
      RewriteCond %{DOCUMENT_ROOT}/static/index.html -f
      RewriteRule .? page-cache/index.html [L]
      RewriteCond %{DOCUMENT_ROOT}/static%{REQUEST_URI}.html -f
      RewriteRule . static%{REQUEST_URI}.html [L]

    ```

用法
==

[](#用法)

### 使用中间件

[](#使用中间件)

```
Router::middleware('page-cache')->get('');

```

### 清除缓存

[](#清除缓存)

`uri`:可选参数，指定要删除缓存的静态文件

```
php artisan page-cache:clear uri

```

### 生成缓存

[](#生成缓存)

`uri`:可选参数，指定要生成缓存的url

```
php artisan page-cache:create uri

```

配置参数
====

[](#配置参数)

```
config/pageCache.php

```

- 是否自动失效:

    ```
      isAutoExpired：true | false

    ```
- 有效时间（分钟）:

    ```
      expire：默认30分钟

    ```
- 缓存目录:

    ```
      cachePath：path

    ```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

4

Last Release

2587d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b248f8f7fb61ee4e9e2f661a993b603f679023ead09f3655cc8cfd6cfdfe6f4?d=identicon)[fts3232](/maintainers/fts3232)

---

Top Contributors

[![fts3232](https://avatars.githubusercontent.com/u/14908395?v=4)](https://github.com/fts3232 "fts3232 (19 commits)")

---

Tags

laravelcache response

### Embed Badge

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

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

###  Alternatives

[silber/page-cache

Caches responses as static files on disk for lightning fast page loads.

1.3k441.9k6](/packages/silber-page-cache)[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

292.6k](/packages/antennaio-laravel-clyde)

PHPackages © 2026

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