11import { Suspense } from 'react'
22import Header from '@/components/common/Header'
33import Footer from '@/components/common/Footer'
4- import MeetTheTeam from '@/components/AboutUs /MeetTheTeam'
4+ import MeetTheTeam from '@/components/about /MeetTheTeam'
55import Hero from '@/components/about/Hero'
66import Descriptions from '@/components/about/Descriptions'
77import MeetTheWDCCTeam from '@/components/about/MeetTheWDCCTeam'
88import QuotesSection from '@/components/about/QuotesSection'
9- import { getAboutPageImages } from '@/lib/payload/images'
9+ import { getAllAboutPageImages } from '@/lib/payload/images'
10+ import { getMembers } from '@/lib/payload/members'
1011
11- // Use dynamic rendering to avoid build-time fetch errors, but cache for 5 minutes in production
12- export const dynamic = 'force-dynamic'
13- export const revalidate = 300
12+ // ISR: Revalidate every 30 minutes — content changes infrequently
13+ export const revalidate = 1800
1414
15- // ✅ Loading fallback
1615function SectionSkeleton ( ) {
1716 return (
1817 < div className = "py-12 px-4" >
@@ -21,44 +20,42 @@ function SectionSkeleton() {
2120 )
2221}
2322
24- // ✅ Independent async components
25- async function HeroContent ( ) {
26- const heroImage = await getAboutPageImages ( 'hero' )
27- return < Hero heroImage = { heroImage } />
28- }
23+ async function AboutContent ( ) {
24+ // Fetch images in one query + members in parallel (2 DB queries instead of 5)
25+ const [ allImages , members ] = await Promise . all ( [ getAllAboutPageImages ( ) , getMembers ( ) ] )
26+
27+ // Filter by placement in memory — instant, no extra DB round-trips
28+ const heroImage = allImages . filter ( ( img ) => img . placement === 'hero' )
29+ const descriptionImage1 = allImages . filter ( ( img ) => img . placement === 'description-1' )
30+ const descriptionImage2 = allImages . filter ( ( img ) => img . placement === 'description-2' )
31+ const quoteImage = allImages . filter ( ( img ) => img . placement === 'quote' )
2932
30- async function DescriptionsContent ( ) {
31- const [ descriptionImage1 , descriptionImage2 ] = await Promise . all ( [
32- getAboutPageImages ( 'description-1' ) ,
33- getAboutPageImages ( 'description-2' ) ,
34- ] )
3533 return (
36- < Descriptions descriptionImage1 = { descriptionImage1 } descriptionImage2 = { descriptionImage2 } />
34+ < >
35+ < Hero heroImage = { heroImage } />
36+ < Descriptions descriptionImage1 = { descriptionImage1 } descriptionImage2 = { descriptionImage2 } />
37+ < MeetTheTeam members = { members } />
38+ < QuotesSection quoteImage = { quoteImage } />
39+ </ >
3740 )
3841}
3942
40- async function QuotesContent ( ) {
41- const quoteImage = await getAboutPageImages ( 'quote' )
42- return < QuotesSection quoteImage = { quoteImage } />
43- }
44-
4543export default function AboutPage ( ) {
4644 return (
4745 < div className = "home" >
4846 < Header />
4947
50- < Suspense fallback = { < SectionSkeleton /> } >
51- < HeroContent />
52- </ Suspense >
53-
54- < Suspense fallback = { < SectionSkeleton /> } >
55- < DescriptionsContent />
56- </ Suspense >
57-
58- < MeetTheTeam />
59-
60- < Suspense fallback = { < SectionSkeleton /> } >
61- < QuotesContent />
48+ < Suspense
49+ fallback = {
50+ < >
51+ < SectionSkeleton />
52+ < SectionSkeleton />
53+ < SectionSkeleton />
54+ < SectionSkeleton />
55+ </ >
56+ }
57+ >
58+ < AboutContent />
6259 </ Suspense >
6360
6461 < MeetTheWDCCTeam />
0 commit comments