mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS Update HTTP Cache headers docs to include note about testing in dev mode [ci skip]
This commit is contained in:
parent
70c5fd6fed
commit
57184c245c
@ -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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user