perf: apply Vercel React best practices (async-parallel and server-serialization)

This commit is contained in:
AyrisAI
2026-05-16 01:17:45 +03:00
parent 15fee9be38
commit 782e11f795
2 changed files with 12 additions and 8 deletions

View File

@@ -37,18 +37,21 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
export default async function ServiceLocationPage({ params }: Props) {
const { slug, location: locationSlug } = await params;
const [service, location, settings] = await Promise.all([
getServiceBySlug(slug),
// Vercel Best Practice: async-parallel - Fetch independent operations in parallel
const service = await getServiceBySlug(slug);
if (!service) notFound();
const [location, settings, projects] = await Promise.all([
getLocationBySlug(locationSlug),
getSettings()
getSettings(),
getProjectsByService(service.title)
]);
if (!service || !location) {
if (!location) {
notFound();
}
const projects = await getProjectsByService(service.title);
const breadcrumbLd = {
"@context": "https://schema.org",
"@type": "BreadcrumbList",