Skip to content

Open-source status page, incident response and uptime monitoring

chore: add public cache (#1115)

Maximilian Kaske33091d22c052
diff --git a/packages/tinybird/src/client.ts b/packages/tinybird/src/client.ts
index 0a5ff55e4..668845449 100644
--- a/packages/tinybird/src/client.ts
+++ b/packages/tinybird/src/client.ts
@@ -3,6 +3,8 @@ import { z } from "zod";
import { flyRegions } from "../../db/src/schema/constants";
import { headersSchema, timingSchema, triggers } from "./schema";
+const PUBLIC_CACHE = 300; // 5 * 60 = 300s = 5m
+
export class OSTinybird {
private readonly tb: Client;
@@ -314,7 +316,11 @@ export class OSTinybird {
count: z.number().default(0),
ok: z.number().default(0),
}),
- opts: { cache: "no-store" },
+ opts: {
+ next: {
+ revalidate: PUBLIC_CACHE,
+ },
+ },
});
}
@@ -655,7 +661,11 @@ export class OSTinybird {
count: z.number().default(0),
ok: z.number().default(0),
}),
- opts: { cache: "no-store" },
+ opts: {
+ next: {
+ revalidate: PUBLIC_CACHE,
+ },
+ },
});
}