diff --git a/app/api/bookmarks/route.ts b/app/api/bookmarks/route.ts index ad59b26..0e03174 100644 --- a/app/api/bookmarks/route.ts +++ b/app/api/bookmarks/route.ts @@ -18,9 +18,7 @@ export async function GET() { headers: { Authorization: `Bearer ${token}`, }, - next: { - revalidate: process.env.NODE_ENV === "production" ? 3600 : undefined, // 1h cache during prod, for dev no cache - }, + cache: "no-store", }); if (response.status !== 200) { diff --git a/app/api/spotify/now/route.ts b/app/api/spotify/now/route.ts index e381b00..3232776 100644 --- a/app/api/spotify/now/route.ts +++ b/app/api/spotify/now/route.ts @@ -62,9 +62,7 @@ export async function GET() { headers: { Authorization: `Bearer ${access_token}`, }, - next: { - revalidate: process.env.NODE_ENV === "production" ? 30 : undefined, // 30s cache during prod, for dev no cache - }, + cache: "no-store", }); if (response.status === 204 || response.status > 400) { diff --git a/app/api/spotify/recent/route.ts b/app/api/spotify/recent/route.ts index 97cbb20..36dc463 100644 --- a/app/api/spotify/recent/route.ts +++ b/app/api/spotify/recent/route.ts @@ -41,9 +41,7 @@ export async function GET() { headers: { Authorization: `Bearer ${access_token}`, }, - next: { - revalidate: process.env.NODE_ENV === "production" ? 30 : undefined, // 30s cache during prod, for dev no cache - }, + cache: "no-store", }); if (response.status !== 200) { diff --git a/components/custom/bookmarks.tsx b/components/custom/bookmarks.tsx index f96bc31..b637931 100644 --- a/components/custom/bookmarks.tsx +++ b/components/custom/bookmarks.tsx @@ -6,7 +6,7 @@ import { formatDistanceToNow } from "date-fns"; import Link from "next/link"; import { Key } from "react"; -const fetcher = (url: string) => fetch(url).then((res) => res.json()); +const fetcher = (url: string) => fetch(url, { cache: "no-store" }).then((res) => res.json()); export default function Bookmarks() { const { data, error, isLoading } = useSWR("/api/bookmarks", fetcher, { diff --git a/components/custom/recently-played.tsx b/components/custom/recently-played.tsx index fea570b..e5ea608 100644 --- a/components/custom/recently-played.tsx +++ b/components/custom/recently-played.tsx @@ -6,7 +6,7 @@ import { NierLoadingIndicator } from "@/components/nier-shell"; import { formatDistanceToNow } from "date-fns"; import { Key } from "react"; -const fetcher = (url: string) => fetch(url).then((res) => res.json()); +const fetcher = (url: string) => fetch(url, { cache: "no-store" }).then((res) => res.json()); export default function RecentlyPlayed() { const { data, error, isLoading } = useSWR("/api/spotify/recent", fetcher, {