Tune caching: shorter revalidate, lighter fetches, on-demand purge.
Use paginated list fetches with stripped list payloads, recent-item helpers for carousels, fetch tags + POST /api/revalidate, and 5-minute page ISR instead of 1 hour. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
f341b010c0
commit
02c7dd51d2
+5
-3
@@ -8,7 +8,9 @@ import { Services } from "@/components/Services";
|
||||
import { SiteFooter } from "@/components/SiteFooter";
|
||||
import { SiteHeader } from "@/components/SiteHeader";
|
||||
import { contact, site } from "@/data/site";
|
||||
import { getBlogs, getPortfolios, toDisplayNewsItem, toDisplayProject } from "@/lib/api";
|
||||
import { getRecentNews, getRecentPortfolios, toDisplayNewsItem, toDisplayProject } from "@/lib/api";
|
||||
|
||||
export const revalidate = 300; // keep in sync with api.ts PAGE_REVALIDATE_SECONDS
|
||||
|
||||
const organizationJsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
@@ -29,9 +31,9 @@ const organizationJsonLd = {
|
||||
};
|
||||
|
||||
export default async function HomePage() {
|
||||
const [portfolios, newsPosts] = await Promise.all([getPortfolios(), getBlogs("news")]);
|
||||
const [portfolios, newsPosts] = await Promise.all([getRecentPortfolios(12), getRecentNews(3)]);
|
||||
const displayProjects = portfolios.map(toDisplayProject);
|
||||
const displayNews = newsPosts.slice(0, 3).map(toDisplayNewsItem);
|
||||
const displayNews = newsPosts.map(toDisplayNewsItem);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user