Skip to content

Commit

Permalink
Merge pull request #48 from garytyler/dont-cache-account-page
Browse files Browse the repository at this point in the history
Don't cache account page
  • Loading branch information
garytyler authored Dec 30, 2024
2 parents b2ac96c + 298389e commit a7b1e30
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.includes('/account/')
) {
response.headers.set('Cache-Control', CACHE_SHORT);
response.headers.set(
'Oxygen-Cache-Control',
Expand Down

0 comments on commit a7b1e30

Please sign in to comment.