Skip to content

Commit

Permalink
Do not cache default WordPress sitemap
Browse files Browse the repository at this point in the history
Fixes #47.
  • Loading branch information
chesio committed Sep 22, 2020
1 parent 3e50571 commit ee75e17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/BlueChip/Cache/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ private static function skipCache(): bool
}

// Do not cache following types of requests.
if (is_search() || is_404() || is_feed() || is_trackback() || is_robots() || is_preview() || post_password_required()) {
// Note: There is no is_sitemap() function, so one has to use get_query_var('sitemap') for now.
if (is_search() || is_404() || is_feed() || is_trackback() || is_robots() || is_preview() || post_password_required() || get_query_var('sitemap')) {
return true;
}

Expand Down

0 comments on commit ee75e17

Please # to comment.