Scheduling infrastructure for absolutely everyone.
fix: set avatar cache control (#11163)
Omar Lópezd7d7bcd65159
diff --git a/apps/web/pages/api/logo.ts b/apps/web/pages/api/logo.tsindex b3e7d859a95..c7cd8207651 100644--- a/apps/web/pages/api/logo.ts+++ b/apps/web/pages/api/logo.ts@@ -187,7 +187,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)}res.setHeader("Content-Type", response.headers.get("content-type") as string);- res.setHeader("Cache-Control", "s-maxage=86400");+ res.setHeader("Cache-Control", "s-maxage=86400, stale-while-revalidate=60");res.send(buffer);} catch (error) {res.statusCode = 404;diff --git a/apps/web/pages/api/user/avatar.ts b/apps/web/pages/api/user/avatar.tsindex a3881970c81..edb6fb24b23 100644--- a/apps/web/pages/api/user/avatar.ts+++ b/apps/web/pages/api/user/avatar.ts@@ -67,6 +67,8 @@ async function getIdentityData(req: NextApiRequest) {export default async function handler(req: NextApiRequest, res: NextApiResponse) {const identity = await getIdentityData(req);const img = identity?.avatar;+ // We cache for one day+ res.setHeader("Cache-Control", "s-maxage=86400, stale-while-revalidate=60");// If image isn't set or links to this route itself, use default avatarif (!img) {if (identity?.org) {