Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 27, 2016
1 parent 6a3455a commit c45f40e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -75,18 +75,20 @@ return [
];
```

Add the `Spatie\Varnish\Middleware\CacheWithVarnish` middleware to the registered route middelwares:
In the published `laravel-varnish.php` config file you should set the `host` key to the right value.

Add the `Spatie\Varnish\Middleware\CacheWithVarnish` middleware to the route middelwares:

```php
// app/Http/Kernel.php

protected $routeMiddleware = [
...
'cacheable' => Spatie\Varnish\Middleware\CacheWithVarnish::class,
]
];
```

Finally, in you should add these lines to the `vcl_backend_reponse` function in your VCL:
Finally, you should add these lines to the `vcl_backend_reponse` function in your VCL (by default this is located at `/etc/varnish/default.vcl` on your server):

```
if (beresp.http.X-Cacheable ~ "1") {
Expand Down

0 comments on commit c45f40e

Please sign in to comment.