2017 © Pedro Peláez
 

library laravel-middleware-cache-response

Laravel中间件-Response缓存

image

flc/laravel-middleware-cache-response

Laravel中间件-Response缓存

  • Thursday, May 10, 2018
  • by flc1125
  • Repository
  • 2 Watchers
  • 36 Stars
  • 482 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 2 Versions
  • 1318 % Grown

The README.md

Laravel中间件-Response缓存

Latest Stable Version Total Downloads License 996.icu LICENSE, (*1)

功能

  • 支持缓存渲染后数据
  • 支持指定缓存过期时间(默认10分钟)
  • header头输出缓存命中状态、缓存Key及过期时间

安装

composer require flc/laravel-middleware-cache-response

配置

\app\Http\Kernel.php文件中$routeMiddleware增加:, (*2)

<?php
'cache.response' => \Flc\Laravel\Http\Middleware\CacheResponse::class,

// cache.response 命名随意,你开心就好

使用

<?php
Route::get('/', function () {
    return view('welcome');
})->middleware('cache.response');

Route::get('/', function () {
    return view('welcome');
})->middleware('cache.response:20');  // 指定缓存时间20分钟

附录

缓存规则, (*3)

  • 当前URL全路径md5

Headers, (*4)

X-Cache:Missed
X-Cache-Expires:2018-03-29 15:08:29 CST
X-Cache-Key:6c9b19774e2c304a42d200f314d8c80b

TODO

  • 增加statusheader的支持

捐赠

如果你觉得本扩展对你有帮助,请捐赠以表支持,谢谢~~, (*5)

微信, (*6)

支付宝, (*7)

License

  • MIT
  • Anti 996

The Versions

10/05 2018

dev-master

9999999-dev

Laravel中间件-Response缓存

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel middleware cache response flc 中间件 缓存

29/03 2018

v1.0

1.0.0.0

Laravel中间件-Response缓存

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel middleware cache response flc 中间件 缓存