Skip to content

Commit 740b510

Browse files
author
wellingtonjr3873
committed
set cookie for app requisitions
1 parent 813ce3a commit 740b510

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

vtex/loaders/intelligentSearch/productListingPage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
getSegmentFromBag,
2222
withSegmentCookie,
2323
} from "../../utils/segment.ts";
24-
import { pageTypesFromUrl } from "../../utils/intelligentSearch.ts";
2524
import { withIsSimilarTo } from "../../utils/similars.ts";
2625
import { getSkipSimulationBehaviorFromBag } from "../../utils/simulationBehavior.ts";
2726
import { slugify } from "../../utils/slugify.ts";

website/pages/Page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ export const loader = async (
159159
) => {
160160
const url = new URL(req.url);
161161
const devMode = url.searchParams.has("__d");
162-
const appMode = url.searchParams.has("__app");
162+
const appMode = url.searchParams.has("__app") || url.searchParams.has("asJson");;
163+
164+
if(appMode){
165+
ctx.response.headers.set('Cache-Control', 'max-age=3500, public')
166+
};
167+
163168
const unindexedDomain = noIndexedDomains.some((domain) =>
164169
url.origin.includes(domain)
165170
);

0 commit comments

Comments
 (0)