CacheHeadersPageView Class Reference
[CacheHeaders]
An overloaded PageView to serve other cache headers. More...
Inheritance diagram for
CacheHeadersPageView:
Protected Member Functions |
|
send_cache_headers ($lastmodified, $expires, $max_age=600, $etag= '') | |
Send cache control headers for cache.
|
Detailed Description
An overloaded PageView to serve other cache headers.
Definition at line 8 of file cacheheaderspageview.cls.php.
Member Function Documentation
CacheHeadersPageView::send_cache_headers | ( | $ | lastmodified, | |
$ | expires, | |||
$ | max_age = 600 , |
|||
$ | etag = '' |
|||
) | [protected] |
Send cache control headers for cache.
- Parameters:
-
$lastmodified A timestamp $expires A timestamp $max_age Max age in seconds
Reimplemented from PageViewBase.
Definition at line 16 of file cacheheaderspageview.cls.php.
00016 { 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 }
The documentation for this class was generated from the following file:
- contributions/page.cacheheaders/view/base/cacheheaderspageview.cls.php