kit icon indicating copy to clipboard operation
kit copied to clipboard

Duplicate requests on vercel using ISR

Open vettloffah opened this issue 1 year ago • 0 comments

Describe the bug

I'm seeing a lot of duplicate requests when a user visits our website. We are running on Sveltekit with ISR using the guide here: https://kit.svelte.dev/docs/adapter-vercel#incremental-static-regeneration

When I inspect the logs in vercel, there are quite a few 200 requests that happen 3 times. I've noticed a pattern that if there is a Cache STALE then there are two Cache MISS requests immediately following it.

If there is a Cache HIT there is only one request.

image

here is config for one of the routes:

export const config = {
	isr: {
		// revalidate every 10 minutes
		expiration: 60 * 10,
		bypassToken: ISR_BYPASS_TOKEN
	}
}

My question is if it's expected behavior for there to be 3 requests (1 cache STALE, 2 cache MISS) or if we have an extra request happening? It's occurred to me it could be the first request to a stale page, then a request to get the new data, but am not sure why there would be a third request.

Reproduction

No reproduction instructions

Logs

No response

System Info

npmPackages:
    @sveltejs/adapter-vercel: ^4.0.5 => 4.0.5 
    @sveltejs/kit: ^2.5.9 => 2.5.9 
    @sveltejs/vite-plugin-svelte: ^3.1.0 => 3.1.0 
    svelte: ^4.2.17 => 4.2.17 
    vite: ^5.2.11 => 5.2.11

Deploying on vercel with node 20.x

Severity

annoyance

Additional Information

No response

vettloffah avatar Jun 13 '24 20:06 vettloffah