1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

more browser cache control issues (more fixes coming soon)

This commit is contained in:
secretr
2011-01-15 20:51:35 +00:00
parent 09b09b4624
commit e45fb13eac

View File

@@ -288,7 +288,7 @@ if (abs($_serverTime - $lastSet) > 120)
// //
// H Final HTML // H Final HTML
// //
// browser cache control // browser cache control - FIXME - use this value as AJAX requests cache control!
echo "\n<!-- ".md5(deftrue('e_NOCACHE') ? time() : e107::getPref('e_jslib_browser_cache'))." -->\n"; echo "\n<!-- ".md5(deftrue('e_NOCACHE') ? time() : e107::getPref('e_jslib_browser_cache'))." -->\n";
echo "</body></html>"; echo "</body></html>";
@@ -304,6 +304,8 @@ $etag = md5($page);
if(!deftrue('e_NOCACHE') && $_SERVER['REQUEST_METHOD'] === 'GET') if(!deftrue('e_NOCACHE') && $_SERVER['REQUEST_METHOD'] === 'GET')
{ {
header("Cache-Control: must-revalidate", true); header("Cache-Control: must-revalidate", true);
if(e107::getPref('site_page_expires')) // TODO - allow per page
{
if (function_exists('date_default_timezone_set')) if (function_exists('date_default_timezone_set'))
{ {
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
@@ -311,6 +313,7 @@ if(!deftrue('e_NOCACHE') && $_SERVER['REQUEST_METHOD'] === 'GET')
$time = time()+ 365 * 86400; $time = time()+ 365 * 86400;
header('Expires: '.gmdate("D, d M Y H:i:s", $time).' GMT', true); header('Expires: '.gmdate("D, d M Y H:i:s", $time).' GMT', true);
} }
}
$pref['compression_level'] = 6; $pref['compression_level'] = 6;
$browser_support = FALSE; $browser_support = FALSE;