API15:JCachePage/get
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Get the cached page data
Syntax
get($id=false, $group='page')
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | false | $id The cache data id |
| $group | 'page' | $group The cache data group |
Returns
boolean True if the cache is hit (false else)
Defined in
libraries/joomla/cache/handler/page.php
Importing
jimport( 'joomla.cache.handler.page' );
Source Body
function get( $id=false, $group='page' ) { // Initialize variables $data = false; // If an id is not given generate it from the request if ($id == false) { $id = $this->_makeId(); } // If the etag matches the page id ... sent a no change header and exit : utilize browser cache if ( !headers_sent() && isset($_SERVER['HTTP_IF_NONE_MATCH']) ){ $etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); if( $etag == $id) { $browserCache = isset($this->_options['browsercache']) ? $this->_options['browsercache'] : false; if ($browserCache) { $this->_noChange(); } } } // We got a cache hit... set the etag header and echo the page data $data = parent::get($id, $group); if ($data !== false) { $this->_setEtag($id); return $data; } // Set id and group placeholders $this->_id = $id; $this->_group = $group; return false; }
[Edit See Also] SeeAlso:JCachePage/get
Examples
<CodeExamplesForm />
