From 57184c245cd1212b428f7990c87ef8dd559512c6 Mon Sep 17 00:00:00 2001 From: Scott Hutchinson Date: Fri, 22 Feb 2019 10:16:11 +1300 Subject: [PATCH] DOCS Update HTTP Cache headers docs to include note about testing in dev mode [ci skip] --- .../08_Performance/02_HTTP_Cache_Headers.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md b/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md index e883110b9..79f4cbb9b 100644 --- a/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md +++ b/docs/en/02_Developer_Guides/08_Performance/02_HTTP_Cache_Headers.md @@ -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. \ No newline at end of file +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 +```