Next.js App Router site cuts Vercel edge costs by 80% with three targeted fixes
CardCheck, an Indian credit card comparison platform, was consuming over 230% of its Vercel Hobby tier CPU allowance and nearing 1 million monthly edge requests. Investigation revealed three root causes: middleware running unnecessary auth checks on every request, public pages configured with force-dynamic that bypassed CDN caching, and a middleware matcher that triggered serverless invocations for static assets and crawlers. The team resolved the auth issue by adding a cookie check to skip session verification for unauthenticated users, who make up over 95% of visitors. They also tightened the middleware matcher to exclude static files and sitemaps, and replaced force-dynamic with Incremental Static Regeneration using revalidate intervals. All three changes were deployed in under an hour and reduced daily resource consumption by more than 80% within 24 hours.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in