Skip to content

Commit 3baa82c

Browse files
authored
Merge pull request #2320 from pyth-network/cprussin/fix-insights-cache
fix(insights): remove data caching & pregeneration, add revalidate
2 parents ac83809 + 517962f commit 3baa82c

File tree

14 files changed

+226
-337
lines changed

14 files changed

+226
-337
lines changed

apps/insights/src/app/layout.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
export { Root as default } from "../components/Root";
22
export { metadata, viewport } from "../metadata";
3+
4+
export const revalidate = 3600;
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type { Metadata } from "next";
22

3-
import { Cluster, getFeeds } from "../../../services/pyth";
43
export { PriceFeedLayout as default } from "../../../components/PriceFeed/layout";
54

65
export const metadata: Metadata = {
76
title: "Price Feeds",
87
};
98

10-
export const generateStaticParams = async () => {
11-
const feeds = await getFeeds(Cluster.Pythnet);
12-
return feeds.map(({ symbol }) => ({ slug: encodeURIComponent(symbol) }));
13-
};
9+
export const revalidate = 3600;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export { ChartPage as default } from "../../../components/PriceFeed/chart-page";
2+
3+
export const revalidate = 3600;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export { Publishers as default } from "../../../../components/PriceFeed/publishers";
2+
3+
export const revalidate = 3600;

apps/insights/src/app/price-feeds/page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ export { PriceFeeds as default } from "../../components/PriceFeeds";
55
export const metadata: Metadata = {
66
title: "Price Feeds",
77
};
8+
9+
export const revalidate = 3600;
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type { Metadata } from "next";
22

33
export { PublishersLayout as default } from "../../../components/Publisher/layout";
4-
import { getPublishers } from "../../../services/clickhouse";
54

65
export const metadata: Metadata = {
76
title: "Publishers",
87
};
98

10-
export const generateStaticParams = async () => {
11-
const publishers = await getPublishers();
12-
return publishers.map(({ key }) => ({ key }));
13-
};
9+
export const revalidate = 3600;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export { Performance as default } from "../../../components/Publisher/performance";
2+
3+
export const revalidate = 3600;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export { PriceFeeds as default } from "../../../../components/Publisher/price-feeds";
2+
3+
export const revalidate = 3600;

apps/insights/src/app/publishers/page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ export { Publishers as default } from "../../components/Publishers";
55
export const metadata: Metadata = {
66
title: "Publishers",
77
};
8+
9+
export const revalidate = 3600;

apps/insights/src/cache.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)