diff --git a/components/com_ajax/ajax.php b/components/com_ajax/ajax.php index 96d78af591328..8619b320943b3 100644 --- a/components/com_ajax/ajax.php +++ b/components/com_ajax/ajax.php @@ -18,8 +18,9 @@ * - https://groups.google.com/d/msg/joomla-dev-cms/WsC0nA9Fixo/Ur-gPqpqh-EJ */ -// Reference global application object +/** @var \Joomla\CMS\Application\CMSApplication $app */ $app = JFactory::getApplication(); +$app->allowCache(false); // JInput object $input = $app->input; diff --git a/components/com_config/controller/display.php b/components/com_config/controller/display.php index 074595058a750..073c6d96dc2e4 100644 --- a/components/com_config/controller/display.php +++ b/components/com_config/controller/display.php @@ -106,6 +106,7 @@ public function execute() // Reply for service requests if ($viewFormat === 'json') { + $this->app->allowCache(false); return $view->render(); } diff --git a/components/com_finder/controllers/suggestions.json.php b/components/com_finder/controllers/suggestions.json.php index b185d626e4cba..3d7c89cfd7b60 100644 --- a/components/com_finder/controllers/suggestions.json.php +++ b/components/com_finder/controllers/suggestions.json.php @@ -25,9 +25,13 @@ class FinderControllerSuggestions extends JControllerLegacy */ public function suggest() { + /** @var \Joomla\CMS\Application\CMSApplication $app */ $app = JFactory::getApplication(); $app->mimeType = 'application/json'; + // Ensure caching is disabled as it depends on the query param in the model + $app->allowCache(false); + $suggestions = $this->getSuggestions(); // Send the response. @@ -50,9 +54,13 @@ public function suggest() */ public function display($cachable = false, $urlparams = false) { + /** @var \Joomla\CMS\Application\CMSApplication $app */ $app = JFactory::getApplication(); $app->mimeType = 'application/json'; + // Ensure caching is disabled as it depends on the query param in the model + $app->allowCache(false); + $suggestions = $this->getSuggestions(); // Send the response. diff --git a/libraries/src/Document/ErrorDocument.php b/libraries/src/Document/ErrorDocument.php index 109ae4e37a8d9..9f628d39fd451 100644 --- a/libraries/src/Document/ErrorDocument.php +++ b/libraries/src/Document/ErrorDocument.php @@ -174,7 +174,7 @@ public function render($cache = false, $params = array()) // Load $data = $this->_loadTemplate($directory . '/' . $template, $file); - parent::render(); + parent::render($cache, $params); return $data; } diff --git a/libraries/src/Document/FeedDocument.php b/libraries/src/Document/FeedDocument.php index d297c47796995..b123d4e710a42 100644 --- a/libraries/src/Document/FeedDocument.php +++ b/libraries/src/Document/FeedDocument.php @@ -222,7 +222,7 @@ public function render($cache = false, $params = array()) // Render the feed $data .= $renderer->render(); - parent::render(); + parent::render($cache, $params); return $data; } diff --git a/libraries/src/Document/HtmlDocument.php b/libraries/src/Document/HtmlDocument.php index dda4a44bb2096..d6f5e3809f910 100644 --- a/libraries/src/Document/HtmlDocument.php +++ b/libraries/src/Document/HtmlDocument.php @@ -555,7 +555,7 @@ public function render($caching = false, $params = array()) } $data = $this->_renderTemplate(); - parent::render(); + parent::render($caching, $params); return $data; } diff --git a/libraries/src/Document/ImageDocument.php b/libraries/src/Document/ImageDocument.php index 6e3672ecc9612..0c849fcf04524 100644 --- a/libraries/src/Document/ImageDocument.php +++ b/libraries/src/Document/ImageDocument.php @@ -67,7 +67,7 @@ public function render($cache = false, $params = array()) $this->_charset = null; - parent::render(); + parent::render($cache, $params); return $this->getBuffer(); } diff --git a/libraries/src/Document/JsonDocument.php b/libraries/src/Document/JsonDocument.php index 288e35de28fa2..df99b8131c06d 100644 --- a/libraries/src/Document/JsonDocument.php +++ b/libraries/src/Document/JsonDocument.php @@ -66,9 +66,10 @@ public function __construct($options = array()) */ public function render($cache = false, $params = array()) { + /** @var \Joomla\CMS\Application\CMSApplication $app **/ $app = \JFactory::getApplication(); - $app->allowCache(false); + $app->allowCache($cache); if ($this->_mime == 'application/json') { @@ -76,7 +77,7 @@ public function render($cache = false, $params = array()) $app->setHeader('Content-Disposition', 'attachment; filename="' . $this->getName() . '.json"', true); } - parent::render(); + parent::render($cache, $params); return $this->getBuffer(); } diff --git a/libraries/src/Document/OpensearchDocument.php b/libraries/src/Document/OpensearchDocument.php index fdb3995d6b4e4..8e5af63965ff5 100644 --- a/libraries/src/Document/OpensearchDocument.php +++ b/libraries/src/Document/OpensearchDocument.php @@ -176,7 +176,7 @@ public function render($cache = false, $params = array()) } $xml->appendChild($elOs); - parent::render(); + parent::render($cache, $params); return $xml->saveXml(); } diff --git a/libraries/src/Document/RawDocument.php b/libraries/src/Document/RawDocument.php index f869c2162da23..0a755a1f9c55e 100644 --- a/libraries/src/Document/RawDocument.php +++ b/libraries/src/Document/RawDocument.php @@ -47,7 +47,7 @@ public function __construct($options = array()) */ public function render($cache = false, $params = array()) { - parent::render(); + parent::render($cache, $params); return $this->getBuffer(); } diff --git a/libraries/src/Document/XmlDocument.php b/libraries/src/Document/XmlDocument.php index 1020f5e08c653..5f030bf810302 100644 --- a/libraries/src/Document/XmlDocument.php +++ b/libraries/src/Document/XmlDocument.php @@ -63,7 +63,7 @@ public function __construct($options = array()) */ public function render($cache = false, $params = array()) { - parent::render(); + parent::render($cache, $params); $disposition = $this->isDownload ? 'attachment' : 'inline';