You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had the next problem:
HtmlCahe caches only one page and shows these pages to all pages. We had this problem.
The problem was that to get request URL, the plugin uses request->getParam('p'). It's '' an empty string in our system occasionally. So we created "p" query string in our module to fix this problem.
And here is the code that did this:
class HtmlCachePluginBugFixer
{
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
// HtmlCache Plugin have the issue - it requires query parameter p with page url for work.
// This method fixes this issue.
public function fixMissingPParameterInRequest()
{
$uri = $this->request->getUrl();
$requestQueryParams = $this->request->getQueryParams();
$requestQueryParams['p'] = $uri;
$this->request->setQueryParams($requestQueryParams);
}
}
And here is how it executes in our module:
$htmlCachePluginBugFixer = new HtmlCachePluginBugFixer(\Craft::$app->request);
$htmlCachePluginBugFixer->fixMissingPParameterInRequest();
The text was updated successfully, but these errors were encountered:
We had the next problem:
HtmlCahe caches only one page and shows these pages to all pages. We had this problem.
The problem was that to get request URL, the plugin uses request->getParam('p'). It's '' an empty string in our system occasionally. So we created "p" query string in our module to fix this problem.
And here is the code that did this:
And here is how it executes in our module:
The text was updated successfully, but these errors were encountered: