Skip to content

Scheduling infrastructure for absolutely everyone.

Only stale SSR requests

zomarsfe50f04075e1
diff --git a/apps/web/pages/api/trpc/[trpc].ts b/apps/web/pages/api/trpc/[trpc].ts
index 1c8d6f7b745..11e64840bdc 100644
--- a/apps/web/pages/api/trpc/[trpc].ts
+++ b/apps/web/pages/api/trpc/[trpc].ts
@@ -37,7 +37,9 @@ export default trpcNext.createNextApiHandler({
// checking we're doing a query request
const isQuery = type === "query";
- if (allPublic && allOk && isQuery) {
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore ctx.req is available for SSR but not SSG
+ if (!!ctx?.req && allPublic && allOk && isQuery) {
// cache request for 1 day + revalidate once every 5 seconds
const ONE_DAY_IN_SECONDS = 60 * 60 * 24;
return {