With a debugger, the debugger stops in any plugin I try, but not in the cache plugin
Under Administrator->Extensions->Manage I can find the Cache plugin installed
Under Administrator->Extensions->Discover, it is now found.
On my own live website I get the same results, however the Cache header is "Cache-Control: no-cache" instead of "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
I have built a plugin which turns the cache on just before the Response is sent:
class plgSystemGtnocachies extends JPlugin { function plgSystemGtnocachies( &$subject, $config ) { parent::__construct( $subject, $config ); }
function __destruct() { if (!headers_sent()) { $this->setCacheHeaders(); } }
public function onAfterRender() { JApplicationWeb::allowCache( true ); $this->setCacheHeaders(); }
function __destruct() { if (!headers_sent()) { $this->setCacheHeaders(); } } public function onAfterRender() { JApplicationWeb::allowCache( true ); $this->setCacheHeaders(); } private function setCacheHeaders() { JApplicationWeb::setHeader( 'Cache-Control', 'public, max-age=10800', true ); JApplicationWeb::setHeader( 'Vary', 'Cookie', true ); JApplicationWeb::setHeader( 'Pragma', '', true ); }
private function setCacheHeaders() { JApplicationWeb::setHeader( 'Cache-Control', 'public, max-age=10800', true ); JApplicationWeb::setHeader( 'Vary', 'Cookie', true ); JApplicationWeb::setHeader( 'Pragma', '', true ); }
class JEventDispatcher extends JObject
{
public function trigger($event, $args = array())
{
$result = array();
/*
* If no arguments were passed, we still need to pass an empty array to
* the call_user_func_array function.
*/
$args = (array) $args;
$event = strtolower($event);
// Check if any plugins are attached to the event.
if (!isset($this->_methods[$event]) || empty($this->_methods[$event]))
{
// No Plugins Associated To Event!
return $result;
}
// Loop through all plugins having a method matching our event
foreach ($this->_methods[$event] as $key)
{
// Check if the plugin is present.
if (!isset($this->_observers[$key]))
{
continue;
}
// Fire the event for an object based observer.
if (is_object($this->_observers[$key]))
{
$args['event'] = $event;
$value = $this->_observers[$key]->update($args);
------->
}
// Fire the event for a function based observer.
elseif (is_array($this->_observers[$key]))
{
$value = call_user_func_array($this->_observers[$key]['handler'], $args);
}
if (isset($value))
{
$result[] = $value;
}
}
return $result;
}
JApplicationWeb::getInstance->response->cacheableJApplicationWeb::getInstance->response->cacheable
is false again.