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:
Alireza Hassani
2026-08-14 11:32:18 +03:30
co-authored by Cursor
parent f341b010c0
commit 02c7dd51d2
13 changed files with 227 additions and 52 deletions
+5 -3
View File
@@ -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 (
<>