Next.js Discord

Discord Forum

next-intl route causes large amounts of requests (and causing a relatively large bill)

Unanswered
Horned oak gall posted this in #help-forum
Open in Discord
Horned oak gallOP
My so is running a Next.js site that uses next-intl. Today I noticed that she's got 100% of uncached requests to /[locale]/[...rest].ts (which is, for some reason I don't understand yet an SSR page).

The page comes directly from the next-intl example: https://github.com/amannn/next-intl/blob/main/examples/example-app-router/src/app/%5Blocale%5D/%5B...rest%5D/page.tsx

While she does have a decent amount of visitors (5-10k a day), it's still just a static site without any server-side rendered stuff - and it seems like her bills (around 100$ per month) seems unreasonable high for that usage.

Anyone got an idea on what to do here?

3 Replies

American black bear
i suggest reading the next.js docs on ISR
if you have a dynamic route e.g /products/[product-slug] next.js will render the route on server on every request. ISR is a pattern that makes it so you can render the page once, cache it for lets say 15 minutes, and serve the cached version until the cache is revalidated making the data dynamic (if the product info changes for example) while saving computing costs.
Horned oak gallOP
looked into that and made a change to the catch all route so now it's getting cached.

but: there's still TONS of edge requests and I don't fully understand why. since this is a static app, why would there be any edge requests?