Skip to content

Commit

Permalink
Better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Nov 7, 2024
1 parent c96062d commit 4c89aee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Blitz

## 5.9.3 - 2024-11-07

- Fixed a bug in which pages with query strings in their URLs could be cached even when “Do not cache URLs with query strings” was selected ([#729](https://github.com/putyourlightson/craft-blitz/issues/729)).

## 5.9.2 - 2024-11-04

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-blitz",
"description": "Intelligent static page caching for creating lightning-fast sites.",
"version": "5.9.2",
"version": "5.9.3",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/blitz",
"license": "proprietary",
Expand Down
13 changes: 7 additions & 6 deletions src/services/CacheRequestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,14 @@ public function getRequestedCacheableSiteUri(): ?SiteUriModel
}
}

// Add the allowed query string if unique query strings should not be cached as the same page
if (Blitz::$plugin->settings->queryStringCaching !== SettingsModel::QUERY_STRINGS_CACHE_URLS_AS_SAME_PAGE) {
$allowedQueryString = '';
if (Blitz::$plugin->settings->queryStringCaching === SettingsModel::QUERY_STRINGS_DO_NOT_CACHE_URLS) {
$allowedQueryString = $queryString;
} elseif (Blitz::$plugin->settings->queryStringCaching === SettingsModel::QUERY_STRINGS_CACHE_URLS_AS_UNIQUE_PAGES) {
$allowedQueryString = $this->getAllowedQueryString($site->id, '?' . $queryString);

if ($allowedQueryString) {
$uri .= '?' . $allowedQueryString;
}
}
if ($allowedQueryString) {
$uri .= '?' . $allowedQueryString;
}

return new SiteUriModel([
Expand Down

0 comments on commit 4c89aee

Please sign in to comment.