API15:JResponse/allowCache
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
Set/get cachable state for the response
Description:JResponse/allowCache
Syntax
allowCache($allow=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $allow | null | $allow |
Returns
boolean True of browser caching should be allowed
Defined in
libraries/joomla/environment/response.php
Importing
jimport( 'joomla.environment.response' );
Source Body
function allowCache($allow = null) { if (!is_null($allow)) { $GLOBALS['_JRESPONSE']->cachable = (bool) $allow; } return $GLOBALS['_JRESPONSE']->cachable; }
[Edit See Also] SeeAlso:JResponse/allowCache
Examples
<CodeExamplesForm />

From: http://groups.google.com/group/joomla-dev-general/browse_thread/thread/6ef5fe7eba4efc26
How can I override the default joomla headers from within a custom component? I would like to change
to
JResponse::allowCache(true) did the trick. If it helps anyone else, here is the code that worked for me.