Skip to content

Commit cc09f52

Browse files
authored
exclude map from cacheKey (#1570)
* exclude map from cacheKey * fmt
1 parent 5954499 commit cc09f52

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

vtex/loaders/legacy/productListingPage.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,12 @@ export const cacheKey = (props: Props, req: Request, ctx: AppContext) => {
449449
const url = new URL(props.pageHref || req.url);
450450

451451
const searchTerm = url.searchParams.get("ft") || url.searchParams.get("q");
452+
const hasMap = url.search.includes("map=");
452453
const cachedSearchTerms = ctx.cachedSearchTerms ?? [];
453-
if (searchTerm && !cachedSearchTerms.includes(searchTerm.toLowerCase())) {
454+
if (
455+
hasMap ||
456+
(searchTerm && !cachedSearchTerms.includes(searchTerm.toLowerCase()))
457+
) {
454458
return null;
455459
}
456460
const fq = [

0 commit comments

Comments
 (0)