Next.js Discord

Discord Forum

Enorm amount of API calls to Prismic with Next.js

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
I have a huge number API Calls to my prismic API in my Next.js (version 15.x.x, App router).

Prismic monitors round about 4,000,000 API calls which is crazy because we are not even live. Yes, there are a few test visits each day but nothing more.

I tried to log the API calls but those do not nearly add up to 4,000,000 in 14 days.

I also fetch only server side so there should not be any client side hammering of the API.

I'm very thankful for every helping hand!

24 Replies

Giant pandaOP
It is both. I develop local but push to a not public accessible domain
@Giant panda It is both. I develop local but push to a not public accessible domain
American Chinchilla
Try adding rate limiting
This could help
Giant pandaOP
Thanks but never heard of - what is rate limiting
American Chinchilla
It a way to limit the number of calls to your api
So you can set it up to 50 max per minute
Meaning no single client can do more than 50 request in a minute
If they do, the api wont receive their call due to the rate limiter
It prevents spam
Giant pandaOP
Is this a Next.js thing or where can I find it?
Sounds great thanks so much for your help so far!
@Giant panda Is this a Next.js thing or where can I find it?
American Chinchilla
No its for any framework
Its a security mechanism
I think next.js has it too just google it vercel rate limiting
There are other libraries too but i cant seem to find one
I use one in particular but cant find it though its pretty popular
Giant pandaOP
I will check this out!
Do you have a link to the library for me?
Thank you su much!
@Giant panda Do you have a link to the library for me? Thank you su much!
American Chinchilla
Its called upstash
Upstash rate limiting
Giant pandaOP
Thank you!