DOCS Update HTTP Cache headers docs to include note about testing in dev mode [ci skip]

This commit is contained in:
Scott Hutchinson 2019-02-22 10:16:11 +13:00 committed by GitHub
parent 70c5fd6fed
commit 57184c245c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,4 +229,20 @@ SilverStripe\Control\HTTP:
```
Note that if you use `Director::is_ajax()` on cached pages
then you should add `X-Requested-With` to the vary header.
then you should add `X-Requested-With` to the vary header.
## Testing
HTTP Cache headers are disabled in developer environments by default to prevent any confusion around content not updating. To enable HTTP Cache Headers in dev mode you can add the following in yml config.
```yml
---
Name: 'app_httpconfig'
After: '#httpconfig-dev'
Only:
environment: dev
---
SilverStripe\Control\Middleware\HTTPCacheControlMiddleware:
defaultState: 'disabled'
defaultForcingLevel: 0
```