Project

General

Profile

Story #28743 ยป Issue__28743__Add_method_to_send_no-cache_HTTP_headers.patch

Patch version 1 - Thorsten Kahler, 2011-08-04 10:52

View differences:

typo3/install/index.php (revision )
);
// Output the warning message and exit
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
echo $content;
exit();
}
typo3/sysext/cms/tslib/class.tslib_fe.php (revision )
'Cache-Control: max-age='.($this->cacheExpires - $GLOBALS['EXEC_TIME']), // no-cache
'Pragma: public',
);
// Send headers:
foreach($headers as $hL) {
header($hL);
}
$this->isClientCachable = TRUE;
} else {
// Build headers:
$headers = array(
#'Last-Modified: '.gmdate('D, d M Y H:i:s T', $this->register['SYS_LASTCHANGED']),
#'ETag: '.md5($this->content),
#'Cache-Control: no-cache',
#'Pragma: no-cache',
'Cache-Control: private', // Changed to this according to Ole Tange, FI.dk
);
t3lib_utility_Http::sendNoCacheHeaders();
$this->isClientCachable = FALSE;
......
}
}
}
// Send headers:
foreach($headers as $hL) {
header($hL);
}
}
}
/**
* Reporting status whether we can send cache control headers for proxy caching or publishing to static files
t3lib/utility/class.t3lib_utility_http.php (revision )
exit;
}
/**
* Sends cache control headers which disable client caching.
*
* Prevent error message in IE when using a https connection,
* see http://support.microsoft.com/kb/323308/en-us
*
* @static
* @return void
* @since 4.6
* @see http://forge.typo3.org/issues/24125
*/
public static function sendNoCacheHeaders() {
$cacheControl = 'no-cache, must-revalidate';
$pragma = 'no-cache';
$clientInfo = t3lib_div::clientInfo();
if (($clientInfo['BROWSER'] === 'msie') && t3lib_div::getIndpEnv('TYPO3_SSL')) {
// Some IEs can not handle no-cache
$cacheControl = 'must-revalidate';
// IE needs "Pragma: private" if SSL connection
$pragma = 'private';
}
}
header('Cache-Control: ' . $cacheControl);
header('Pragma: ' . $pragma);
}
}
?>
t3lib/class.t3lib_userauth.php (revision )
if ($this->sendNoCacheHeaders) {
header('Expires: 0');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
$cacheControlHeader = 'no-cache, must-revalidate';
$pragmaHeader = 'no-cache';
// Prevent error message in IE when using a https connection
// see http://forge.typo3.org/issues/24125
$clientInfo = t3lib_div::clientInfo();
if (($clientInfo['BROWSER'] === 'msie') && t3lib_div::getIndpEnv('TYPO3_SSL')) {
// Some IEs can not handle no-cache
// see http://support.microsoft.com/kb/323308/en-us
$cacheControlHeader = 'must-revalidate';
// IE needs "Pragma: private" if SSL connection
$pragmaHeader = 'private';
t3lib_utility_Http::sendNoCacheHeaders();
}
}
header('Cache-Control: ' . $cacheControlHeader);
header('Pragma: ' . $pragmaHeader);
}
// Set $this->gc_time if not explicitely specified
if ($this->gc_time == 0) {
$this->gc_time = ($this->auth_timeout_field == 0 ? 86400 : $this->auth_timeout_field); // Default to 1 day if $this->auth_timeout_field is 0
typo3/sysext/form/Classes/View/Wizard/Load.php (revision )
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
header('Content-Length: '.strlen($json));
header('Content-Type: application/json; charset=utf-8');
header('Content-Transfer-Encoding: 8bit');
typo3/sysext/install/mod/class.tx_install.php (revision )
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Expires: 0');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
}
// ****************************
......
);
// Output the warning message and exit
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
echo $content;
exit();
}
typo3/sysext/form/Classes/View/Wizard/Save.php (revision )
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
header('Content-Length: '.strlen($json));
header('Content-Type: application/json; charset=utf-8');
header('Content-Transfer-Encoding: 8bit');
typo3/sysext/install/mod/class.tx_install_ajax.php (revision )
// see RFC 2616
// see Microsoft Knowledge Base #234067
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
t3lib_utility_Http::sendNoCacheHeaders();
header('Expires: -1');
}
}
    (1-1/1)