On this page
What this issue is
Serverless hosting (for example AWS Lambda, Vercel or Netlify functions, Cloudflare Workers or Google Cloud Functions) runs your code only when a request arrives. If nothing has run for a while, the platform must start a fresh instance, load your code and connect to databases or APIs. That startup is the cold start.
Why it costs you leads or sales
Cold starts hit the visitors you least want to lose. A campaign that sends a burst of clicks after a quiet night, or a low-traffic page that is rarely warm, serves its slowest response to the first people who arrive. They are often paid clicks, so you pay for a visit that never sees the page.
- Ad clickVisitor clicks after a quiet period
- Function bootsCold start: several seconds of waiting
- Page rendersVisitor has already left
- Form submitNever reached
- Conversion tagNever fires
The visitor never reaches the form when the first response is too slow.
Example: illustrative TTFB values for one landing page. Your numbers will differ by platform and code.
How to check if your site has it
Leave the page idle
Do not visit the landing page for 15 to 30 minutes. Idle times differ by platform, so try longer gaps too.
Measure the first request
Run the command below, then repeat it straight away and compare the two times.
Check the platform logs
AWS Lambda logs an Init Duration in the REPORT line of CloudWatch for cold invocations. Vercel and Netlify show function durations in their logs.
Test from another region
Edge caches and function regions differ, so a page can be warm in one place and cold in another.
curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s total: %{time_total}s\n" https://example.com/landing
sleep 2
curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s total: %{time_total}s\n" https://example.com/landingHow to fix it
The best fix is to avoid running a function for the landing page at all. Work down this list until the first response is fast.
Serve the page as static or cached HTML
Pre-build the landing page, or cache the rendered HTML at the CDN with a Cache-Control header such as s-maxage and stale-while-revalidate. Visitors then get a file, not a function.
Keep the function small
Remove unused dependencies, load heavy libraries only when needed and avoid big bundles. Less code to load means a shorter start.
Move slow work out of startup
Do not open database connections or fetch CMS content during initialisation if the page can be built ahead of time. Reuse connections between calls.
Pick a faster runtime or region
Edge runtimes and lighter languages usually start faster. Deploy the function in the region closest to your visitors and data.
Keep instances warm if you must
Use the platform's provisioned or reserved concurrency (AWS Lambda), or a scheduled ping to the route. Warm-up is a workaround, and it can cost money or miss parallel cold instances.
Make the form handler resilient
Use a longer client timeout and a retry, or send the form to a service that is always running, so a cold handler does not drop the lead.
Cache at the CDN
Send a header like Cache-Control: public, s-maxage=3600, stale-while-revalidate=86400 on the landing page response so the CDN serves it without calling the function.
Pre-render the page
In frameworks such as Next.js, Nuxt or Astro, use static generation for the landing page instead of per-request rendering.
Check what is serverless
Webflow pages are served from its CDN. If the slow part is an external function, such as a form webhook or API, optimise or host that separately.
Check for headless setups
Standard WordPress is not serverless. If you use a headless front end on a serverless host, make that front end static or cached.
Do not rely on late tags
GTM cannot fix a slow server. Once the page responds quickly, check that the container loads early enough for your tags to fire.
How to confirm it's fixed
- Wait out the idle period and request the page again
- First and second request TTFB are close to each other
- Response headers show the page served from the CDN cache
- Test from at least two regions
- Submit the form after an idle period and confirm the lead arrives
- Check that the conversion tags fire on the first visit
Before
- Page rendered by a function on every request
- First visit after idle waits seconds
- Form handler can time out when cold
After
- Page served as cached or static HTML
- First and later visits respond at similar speed
- Form handler is lean and retried on failure
How to prevent it happening again
- Keep landing pages static or cached by default
- Set a TTFB budget and review it after each deploy
- Watch bundle size when you add dependencies
- Test after quiet periods, such as early morning, before campaigns launch
- Re-check after changing runtime, region or hosting plan
How FunnelGuard handles this
FunnelGuard detects this only partly. Its robot visitor runs your journeys on a schedule, and it flags a TTFB anomaly: a response time that is unusually slow compared with the page's normal pattern. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause.
Questions people ask
What is a cold start on a serverless landing page?
A cold start is the delay when a serverless platform must start a new instance of your function before answering. It happens after idle time or a traffic jump. The visitor waits longer for the first byte of the page.
Why is my landing page slow on the first visit but fast after?
The first request may have triggered a cold start, or missed the CDN cache. Later requests reuse the warm instance or the cached copy. Compare the TTFB of two requests with curl to see the gap.
How do I fix slow cold starts on Vercel, Netlify or AWS Lambda?
Serve the landing page as static or cached HTML so no function runs. If a function is needed, shrink its bundle, avoid heavy startup work, and deploy it near your visitors. AWS Lambda also offers provisioned concurrency to keep instances ready.
Do cold starts affect form submissions?
Yes, if the form handler is a serverless function. A cold handler can respond slowly or time out, and the lead may be lost. Use a retry, a longer timeout, or a handler that is always running.
How do I measure TTFB to spot a cold start?
Run curl with the time_starttransfer variable after the page has been idle, then run it again straight away. A first result several times slower than the second points to a cold start. Check platform logs for an init duration to confirm.
Does keeping a function warm with a ping solve it?
It helps but is not a full fix. A ping warms one instance, while a burst of visitors may need several, and each extra one starts cold. Static or cached pages are more reliable.
Can FunnelGuard detect cold starts?
Only partly. It flags a TTFB anomaly when a page responds unusually slowly, but it cannot confirm that a cold start is the cause. You need to check function logs and test after idle periods yourself.
Related issues
- OPS-091Auto-scaling failure during traffic peakFix guide
- OPS-090One bad node behind load balancer (random failures)Fix guide
- OPS-094Rate limiting on host blocks normal visitorsFix guide
- OPS-095Compression (gzip/brotli) disabledFix guide
- OPS-096HTTP/2 or HTTP/3 not enabledFix guide
- OPS-074CPU throttling / entry process limits on shared hostingFix guide