|
1 | 1 | ## HttpCache for Laravel
|
| 2 | +[](https://github.com/barryvdh/laravel-httpcache/actions) |
| 3 | +[](http://choosealicense.com/licenses/mit/) |
| 4 | +[](https://packagist.org/packages/barryvdh/laravel-httpcache) |
| 5 | +[](https://packagist.org/packages/barryvdh/laravel-httpcache) |
| 6 | +[](https://fruitcake.nl/) |
2 | 7 |
|
3 |
| -### For Laravel 4.1+, require [v0.1.x](https://github.com/barryvdh/laravel-httpcache/tree/v0.1.1) |
4 |
| - |
5 |
| -Laravel 5 can use [HttpKernelInterface Middlewares](http://stackphp.com/middlewares/), so also [HttpCache](http://symfony.com/doc/current/book/http_cache.html). |
| 8 | +Laravel can use [HttpKernelInterface Middlewares](http://stackphp.com/middlewares/), so also [HttpCache](http://symfony.com/doc/current/book/http_cache.html). |
6 | 9 | This package provides a simple ServiceProvider to get you started with HttpCache.
|
7 | 10 |
|
8 | 11 | First, require this package with composer
|
9 | 12 |
|
10 |
| - composer require barryvdh/laravel-httpcache |
| 13 | +``` |
| 14 | +composer require barryvdh/laravel-httpcache |
| 15 | +``` |
11 | 16 |
|
12 | 17 | After updating, add the ServiceProvider to the array of providers in app/config/app.php
|
13 | 18 |
|
14 |
| - 'Barryvdh\HttpCache\ServiceProvider', |
| 19 | +``` |
| 20 | +'Barryvdh\HttpCache\ServiceProvider', |
| 21 | +``` |
15 | 22 |
|
16 | 23 | You can now add the Middleware to your Kernel:
|
17 | 24 |
|
18 |
| - 'Barryvdh\HttpCache\Middleware\CacheRequests', |
| 25 | +``` |
| 26 | +'Barryvdh\HttpCache\Middleware\CacheRequests', |
| 27 | +``` |
19 | 28 |
|
20 | 29 | Caching is now enabled, for public responses. Just set the Ttl or MaxSharedAge
|
21 | 30 |
|
|
0 commit comments