mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update docs for Vary: X-Requested-With
This commit is contained in:
parent
9c9872ebac
commit
72ce2b422d
@ -918,6 +918,9 @@ class Director implements TemplateGlobalProvider {
|
|||||||
* by checking for a custom header set by jQuery or
|
* by checking for a custom header set by jQuery or
|
||||||
* wether a manually set request-parameter 'ajax' is present.
|
* wether a manually set request-parameter 'ajax' is present.
|
||||||
*
|
*
|
||||||
|
* Note that if you plan to use this to alter your HTTP response on a cached page,
|
||||||
|
* you should add X-Requested-With to the Vary header.
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function is_ajax() {
|
public static function is_ajax() {
|
||||||
|
@ -209,7 +209,7 @@ when calculating a cache key, usually in addition to the full URL path.
|
|||||||
By default, SilverStripe will output a `Vary` header with the following content:
|
By default, SilverStripe will output a `Vary` header with the following content:
|
||||||
|
|
||||||
```
|
```
|
||||||
Vary: X-Requested-With, X-Forwarded-Protocol
|
Vary: X-Forwarded-Protocol
|
||||||
```
|
```
|
||||||
|
|
||||||
To change the value of the `Vary` header, you can change this value by specifying the header in configuration.
|
To change the value of the `Vary` header, you can change this value by specifying the header in configuration.
|
||||||
@ -218,3 +218,6 @@ To change the value of the `Vary` header, you can change this value by specifyin
|
|||||||
HTTP:
|
HTTP:
|
||||||
vary: ""
|
vary: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that if you use `Director::is_ajax()` on cached pages then you should add `X-Requested-With` to the vary
|
||||||
|
header.
|
||||||
|
Loading…
Reference in New Issue
Block a user