All Projects → flc1125 → laravel-middleware-cache-response

flc1125 / laravel-middleware-cache-response

Licence: MIT license
Laravel中间件-Response缓存

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-middleware-cache-response

lifecycle
Lifecycle support for Flutter widgets.
Stars: ✭ 30 (-50.82%)
Mutual labels:  route
vue-error-page
[NO LONGER MAINTAINED] Provides a wrapper for router-view that allows you to show error pages without changing the URL.
Stars: ✭ 52 (-14.75%)
Mutual labels:  route
data-response
www.yiiframework.com/
Stars: ✭ 12 (-80.33%)
Mutual labels:  response
RouteOne
Route for PHP
Stars: ✭ 21 (-65.57%)
Mutual labels:  route
Router
🍭灵活的组件化路由框架.
Stars: ✭ 1,502 (+2362.3%)
Mutual labels:  route
reqres
Powerful classes for http requests and responses
Stars: ✭ 36 (-40.98%)
Mutual labels:  response
optimized-route
Website that uses the Google Maps API to create an optimized route between waypoints. (My first website, from 2016).
Stars: ✭ 17 (-72.13%)
Mutual labels:  route
tentacool
REST API to manage Linux networking via netlink
Stars: ✭ 63 (+3.28%)
Mutual labels:  route
Framework
ThinkPHP Framework
Stars: ✭ 2,399 (+3832.79%)
Mutual labels:  route
Beerus
Beerus is a web framework developed entirely in go, Based on net/http, it extends the management of routes, adds interceptors, session management, receiving parameters with struct, parameter validation, etc. It also provides WebSocket support to upgrade the http protocol to WebSocket and implement communication.
Stars: ✭ 24 (-60.66%)
Mutual labels:  route
koii
A simple middleware for displaying routes in an express application
Stars: ✭ 73 (+19.67%)
Mutual labels:  route
Think
ThinkPHP Framework ——十年匠心的高性能PHP框架
Stars: ✭ 7,681 (+12491.8%)
Mutual labels:  route
chronosjs
JS Channels (Events / Commands / Reqest-Response / Courier) Mechanism
Stars: ✭ 35 (-42.62%)
Mutual labels:  response
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+132.79%)
Mutual labels:  route
node-match-path
Matches a URL against a path. Parameters, wildcards, RegExp.
Stars: ✭ 30 (-50.82%)
Mutual labels:  route
airoute
*1、Support routing management without context *2、Support 'non-intrusive parameter passing' routing management *3、Airoute that makes you fall in love with routing management
Stars: ✭ 27 (-55.74%)
Mutual labels:  route
symfony-route-usage
[READ-ONLY] Detect used and unused Symfony routes
Stars: ✭ 41 (-32.79%)
Mutual labels:  route
path-to-regexp-php
PHP port of https://github.com/pillarjs/path-to-regexp
Stars: ✭ 21 (-65.57%)
Mutual labels:  route
ember-contextual-services
Services in Ember are scoped to the app as a whole and are singletons. Sometimes you don't want that. :) This addon provides ephemeral route-based services.
Stars: ✭ 20 (-67.21%)
Mutual labels:  route
html
HTML templating and streaming response library for Service Worker-like environments such as Cloudflare Workers.
Stars: ✭ 41 (-32.79%)
Mutual labels:  response

Laravel中间件-Response缓存

Latest Stable Version Total Downloads License 996.icu LICENSE

功能

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

安装

composer require flc/laravel-middleware-cache-response

配置

\app\Http\Kernel.php文件中$routeMiddleware增加:

<?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分钟

附录

缓存规则

  • 当前URL全路径md5

Headers

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

TODO

  • 增加statusheader的支持

捐赠

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

微信

支付宝

License

  • MIT
  • Anti 996
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].