The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
import { NewsArticle } from "@/ui/layout/sidebar/news";
import { cache } from "react";
export const getContentAPI: () => Promise<{
latestNewsArticles: NewsArticle[];
}> = cache(async () => {
try {
return await fetch("https://dub.co/api/content", {
next: {
revalidate: 60 * 60 * 24, // cache for 24 hours
},
}).then((res) => res.json());
} catch (e) {
return {
latestNewsArticles: [],
};
}
});