Skip to content

Commit c59fdef

Browse files
committed
actually turn on ssg, I think
1 parent bd25937 commit c59fdef

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

web/src/app/api/agents/route.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,16 @@ export async function GET() {
264264

265265
const response = NextResponse.json(result)
266266

267-
// Add cache headers for CDN and browser caching
267+
// Add optimized cache headers for better performance
268268
response.headers.set(
269269
'Cache-Control',
270-
'public, max-age=600, s-maxage=600, stale-while-revalidate=600'
270+
'public, max-age=300, s-maxage=600, stale-while-revalidate=3600'
271271
)
272272

273-
// Add additional headers for better CDN caching
273+
// Add compression and optimization headers
274274
response.headers.set('Vary', 'Accept-Encoding')
275275
response.headers.set('X-Content-Type-Options', 'nosniff')
276+
response.headers.set('Content-Type', 'application/json; charset=utf-8')
276277

277278
return response
278279
} catch (error) {

web/src/app/store/loading.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
export default function StoreLoading() {
2+
return (
3+
<div className="container mx-auto py-8 px-4">
4+
<div className="max-w-7xl mx-auto">
5+
{/* Header skeleton */}
6+
<div className="mb-12">
7+
<div className="flex items-center justify-between mb-4">
8+
<div>
9+
<div className="h-10 w-64 bg-muted animate-pulse rounded mb-2" />
10+
<div className="h-6 w-96 bg-muted animate-pulse rounded" />
11+
</div>
12+
</div>
13+
</div>
14+
15+
{/* Search and filters skeleton */}
16+
<div className="mb-8">
17+
<div className="flex flex-col md:flex-row gap-4 items-stretch md:items-center md:justify-end">
18+
<div className="w-full md:flex-1 md:max-w-[200px]">
19+
<div className="h-10 bg-muted animate-pulse rounded" />
20+
</div>
21+
<div className="flex gap-3 w-full md:w-auto">
22+
<div className="h-10 w-40 bg-muted animate-pulse rounded" />
23+
<div className="h-10 w-32 bg-muted animate-pulse rounded" />
24+
</div>
25+
</div>
26+
</div>
27+
28+
{/* Editor's choice skeleton */}
29+
<div className="mb-12">
30+
<div className="mb-6">
31+
<div className="h-8 w-48 bg-muted animate-pulse rounded mb-2" />
32+
<div className="h-4 w-full max-w-2xl bg-muted animate-pulse rounded" />
33+
</div>
34+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
35+
{Array.from({ length: 3 }).map((_, i) => (
36+
<div key={i} className="h-56 bg-muted animate-pulse rounded-lg" />
37+
))}
38+
</div>
39+
</div>
40+
41+
{/* All agents skeleton */}
42+
<div className="mt-12">
43+
<div className="mb-6">
44+
<div className="h-8 w-32 bg-muted animate-pulse rounded mb-2" />
45+
<div className="h-4 w-80 bg-muted animate-pulse rounded" />
46+
</div>
47+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
48+
{Array.from({ length: 12 }).map((_, i) => (
49+
<div key={i} className="h-56 bg-muted animate-pulse rounded-lg" />
50+
))}
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
)
56+
}

web/src/app/store/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export const metadata: Metadata = {
8383

8484
// Enable static site generation with ISR
8585
export const revalidate = 60 * 10 // Revalidate every 10 minutes
86+
export const dynamic = 'force-static'
87+
export const fetchCache = 'force-cache'
8688

8789
// Generate static params for common search/sort combinations
8890
export async function generateStaticParams() {

0 commit comments

Comments
 (0)