Looking to hire Laravel developers? Try LaraJobs

laravel-html-caching maintained by cuatao

Author
Last update
2017/10/19 09:14 (dev-master)
Links
Downloads
65

Comments
comments powered by Disqus

Install

composer require cuatao/laravel-html-caching

Publish the package config file

php artisan vendor:publish

Register as route middleware

// within app/Http/Kernel.php

protected $routeMiddleware = [
    //
    \Cuatao\LaravelHtmlCaching\Http\Middleware\ResponseHtmlCachingBeforeMiddleware::class,
    \Cuatao\LaravelHtmlCaching\Http\Middleware\ResponseHtmlCachingAfterMiddleware::class,
    //
];

Apply HTML response cache to routes

// within routes/web.php

Route::get('/', function () {
    return view('welcome');
})->middleware('web');