Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 720 Bytes

NoCache.md

File metadata and controls

26 lines (22 loc) · 720 Bytes

NoCache

Class: \Midnite81\Core\Http\Middleware\NoCache

This middleware adds cache busting headers to the request. This is useful for ensuring that the latest version of the route is being used.

Usage

You can use it directly on the route as follows;

Route::get('/', function () {
    return view('welcome');
})->middleware(\Midnite81\Core\Http\Middleware\NoCache::class);

If you add it to the app/Http/Kernel.php file, under the $routeMiddleware property, you can use it by its alias.

protected $routeMiddleware = [
    'no-cache' => \Midnite81\Core\Http\Middleware\NoCache::class,
];
Route::get('/', function () {
    return view('welcome');
})->middleware('no-cache');