Merge pull request #8819 from scott1702/patch-4

DOCS Update HTTP Cache headers docs to include note about testing in dev mode
This commit is contained in:
Guy Marriott 2019-02-22 12:24:51 +13:00 committed by GitHub
commit 9773ee0330
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
```