Skip to content

Commit

Permalink
don't cache account or checkout pages
Browse files Browse the repository at this point in the history
  • Loading branch information
garytyler committed Dec 30, 2024
1 parent b2ac96c commit 5d7855b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ export default {
return storefrontRedirect({request, response, storefront});
}

if (!new URL(request.url).pathname.endsWith('/cart')) {
const urlPathname = new URL(request.url).pathname;
if (
!urlPathname.endsWith('/cart') &&
!urlPathname.endsWith('/account') &&
!urlPathname.endsWith('/checkout')
) {
response.headers.set('Cache-Control', CACHE_SHORT);
response.headers.set(
'Oxygen-Cache-Control',
Expand Down

0 comments on commit 5d7855b

Please sign in to comment.