Download the PHP package fts/cache-response without Composer
On this page you can find all versions of the php package fts/cache-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download fts/cache-response
More information about fts/cache-response
Files in fts/cache-response
Download fts/cache-response
More information about fts/cache-response
Files in fts/cache-response
Vendor fts
Package cache-response
Short Description laravel 5 response cache
License MIT
Package cache-response
Short Description laravel 5 response cache
License MIT
Keywords laravelcache response
Please rate this library. Is it a good library?
Informations about the package cache-response
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重写
-
对于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
:可选参数,指定要生成缓存的urlphp artisan page-cache:create uri
配置参数
config/pageCache.php
-
是否自动失效:
isAutoExpired:true | false
-
有效时间(分钟):
expire:默认30分钟
-
缓存目录:
cachePath:path
All versions of cache-response with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
illuminate/filesystem Version ~5.0
symfony/http-foundation Version 2.6 - 4
illuminate/filesystem Version ~5.0
symfony/http-foundation Version 2.6 - 4
The package fts/cache-response contains the following files
Loading the files please wait ....