00001 <?php
00002
00003
00004
00005
00006
00007
00008 class CacheHeadersPageView extends PageViewBase {
00009
00010
00011
00012
00013
00014
00015
00016 protected function send_cache_headers($lastmodified, $expires, $max_age = 600, $etag = '') {
00017 $max_age = intval($max_age);
00018 GyroHeaders::remove('Pragma');
00019 GyroHeaders::set('Last-Modified', GyroDate::http_date($lastmodified), true);
00020 GyroHeaders::set('Expires', GyroDate::http_date($expires), true);
00021 GyroHeaders::set('Etag', $etag, true);
00022 switch (Config::get_value(ConfigCacheHeaders::CACHE_POLICY)) {
00023 case ConfigCacheHeaders::RIGID_FRESHNESS:
00024 default:
00025 GyroHeaders::set('Cache-Control', "private, must-revalidate,max-age=0", true);
00026 }
00027 }
00028 }