Skip to content

Fix excessive serverless function invocations on Vercel#31

Merged
kishanasokan merged 1 commit intomainfrom
fix/reduce-serverless-invocations-v2
Mar 26, 2026
Merged

Fix excessive serverless function invocations on Vercel#31
kishanasokan merged 1 commit intomainfrom
fix/reduce-serverless-invocations-v2

Conversation

@tstanmay13
Copy link
Copy Markdown
Collaborator

Summary

  • Disable prefetch on archive links — each archive page visit was triggering ~87 serverless function calls (one per day link). In production logs, 57% of all requests were archive day prefetches, all cache misses hitting serverless functions.
  • Add ISR caching to archive day pagesrevalidate = 3600 (1 hour). Past puzzle data never changes, so subsequent requests serve from edge cache.
  • Switch homepage from force-dynamic to ISRrevalidate = 60 (1 minute). Puzzle changes once per day at midnight EST, so 60s caching is safe. Eliminates redundant SSR for bots, repeat visitors, and concurrent users.

Impact

Change Estimated reduction
Archive prefetch={false} ~87x fewer function calls per archive visit
Archive ISR (1hr) Repeated visits to same day serve from cache
Homepage ISR (60s) ~60x fewer function calls during peak traffic

Test plan

  • All 159 unit/integration tests pass
  • Production build succeeds — homepage shows Revalidate: 1m in build output
  • Verify archive page no longer prefetches day links in Network tab
  • Monitor Vercel function invocation count after deploy

🤖 Generated with Claude Code

Archive page was prefetching every single day link (~87 serverless calls
per visit, 57% of all traffic). Homepage was force-dynamic with zero
caching, triggering full SSR on every request including bots.

- Disable prefetch on archive day links (prefetch={false})
- Add 1-hour ISR cache to archive day pages (revalidate=3600)
- Switch homepage from force-dynamic to 60s ISR (revalidate=60)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
radwordle Ready Ready Preview, Comment Mar 26, 2026 7:34pm

@kishanasokan kishanasokan merged commit 0e6ef63 into main Mar 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants