mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
adding config variable to cancel ajax caching
This commit is contained in:
parent
d9436675a1
commit
06b142a1e5
@ -25,7 +25,12 @@ class HTTP {
|
||||
protected static $etag = null;
|
||||
|
||||
/**
|
||||
* Turns a local system filename into a URL by comparing it to the script
|
||||
* @config
|
||||
*/
|
||||
private static $cache_ajax_requests = true;
|
||||
|
||||
/**
|
||||
* Turns a local system filename into a URL by comparing it to the script
|
||||
* filename.
|
||||
*
|
||||
* @param string
|
||||
@ -325,7 +330,9 @@ class HTTP {
|
||||
|
||||
// Popuplate $responseHeaders with all the headers that we want to build
|
||||
$responseHeaders = array();
|
||||
if(function_exists('apache_request_headers')) {
|
||||
$config = Config::inst();
|
||||
// currently using a config setting to cancel this, seems to be so taht the CMS caches ajax requests
|
||||
if(function_exists('apache_request_headers') && $config->get(get_called_class(), 'cache_ajax_requests')) {
|
||||
$requestHeaders = apache_request_headers();
|
||||
if(isset($requestHeaders['X-Requested-With']) && $requestHeaders['X-Requested-With']=='XMLHttpRequest') {
|
||||
$cacheAge = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user