mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
9773ee0330
@ -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