Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/api/bookmarks/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions app/api/spotify/now/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions app/api/spotify/recent/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion components/custom/bookmarks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion components/custom/recently-played.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Loading