Skip to content

Commit

Permalink
Merge pull request #11 from JamesToothill/patch-1
Browse files Browse the repository at this point in the history
Skip cache if Ajax request
  • Loading branch information
boldenamsterdam authored Dec 27, 2018
2 parents 71a7c27 + 7a8cc55 commit e562848
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/HtmlcacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ public function canCreateCacheFile()
if (\Craft::$app->request->getIsLivePreview()) {
return false;
}
// Skip if it's a post/ajax request
// Skip if it's a post request
if (!\Craft::$app->request->getIsGet()) {
return false;
}
// Skip if it's an ajax request
if (\Craft::$app->request->getIsAjax()) {
return false;
}
// Skip if route from element api
if ($this->isElementApiRoute()) {
return false;
Expand Down

0 comments on commit e562848

Please sign in to comment.