revalidate pertinent information faster

This commit is contained in:
MeowcaTheoRange 2024-05-19 16:56:39 -05:00
parent 7c311cdde7
commit 614cc93b7e
3 changed files with 5 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import { MainLayout } from "@/layout/MainLayout/MainLayout";
import Link from "next/link";
export default async function Home() {
const data = await fetch("https://pronouns.cc/api/v1/users/mtr").then(x=>x.json());
const data = await fetch("https://pronouns.cc/api/v1/users/mtr", { next: { revalidate: 3600 } }).then(x=>x.json());
return (
<MainLayout currentPage="/links/" title="Links" subtitle="to other places I've been">

View file

@ -3,7 +3,7 @@ import Link from "next/link";
import { ConditionalNull, ConditionalParent } from "@/components/utility/Conditional";
export default async function Home() {
const o = await fetch("https://cdn.abtmtr.link/site_content/organizations.json").then(x=>x.json()).catch(_ => null);
const o = await fetch("https://cdn.abtmtr.link/site_content/organizations.json", { next: { revalidate: 60 } }).then(x=>x.json()).catch(_ => null);
const organizations: {
name: string,
url: string,

View file

@ -3,11 +3,10 @@ import Link from "next/link";
import Searchbar from "@/components/Searchbar/Searchbar";
export default async function Home() {
const buttons = await fetch("https://cdn.abtmtr.link/site_content/buttons.json").then(x=>x.json()).catch(_ => null);
const data = await fetch("https://pronouns.cc/api/v1/users/mtr").then(x=>x.json()).catch(_ => null);
const domainreq = await fetch("https://blog.abtmtr.link/api/collections/paste/posts/domain")
const buttons = await fetch("https://cdn.abtmtr.link/site_content/buttons.json", { next: { revalidate: 3600 } }).then(x=>x.json()).catch(_ => null);
const data = await fetch("https://pronouns.cc/api/v1/users/mtr", { next: { revalidate: 3600 } }).then(x=>x.json()).catch(_ => null);
const domains = await fetch("https://cdn.abtmtr.link/site_content/domain.json", { next: { revalidate: 3600 } })
.then(x=>x.json()).catch(_ => "[]");
const domains = JSON.parse(domainreq?.data?.body.replace(/[“”]/g, "\"")) ?? [];
const goodNames = data.names.filter((x:{status:string})=>x.status == "okay");
return (