Skip to content

Commit 4c2e9ed

Browse files
feedback
1 parent 9cd3080 commit 4c2e9ed

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • packages/web/src/app/api/(server)/avatar

packages/web/src/app/api/(server)/avatar/route.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ export const GET = apiHandler(async (request: NextRequest) => {
5555
});
5656
}
5757

58-
// Fallback: identicons are deterministic from the email so they can be
59-
// cached aggressively.
58+
// Fallback: identicon. Cache lifetime matches the redirect path so the
59+
// response naturally revalidates as users sign up, set profile pictures,
60+
// or transient lookup errors recover.
6061
const svg = minidenticon(email, 50, 50);
6162
return new Response(svg, {
6263
status: 200,
6364
headers: {
6465
'Content-Type': 'image/svg+xml',
65-
'Cache-Control': 'public, max-age=31536000, immutable',
66+
'Cache-Control': 'public, max-age=300',
6667
},
6768
});
6869
}, { track: false });

0 commit comments

Comments
 (0)