Hi all, I have a few websites on Netlify, and some pages get a few thousand visitors a month. I use svelte kit and the adapter for Netlify. I don’t understand edge functions (or a lot of what Netlify does in general), but I’m frequently notified that I’m approaching limit on edge functions.
My netlify sites are rgbstudios.org and desktopclock.app. No DNS issues and build runs fine.
Thanks in advance!
To clarify, I’m not sure what an edge function is or when it runs. Is it when I deploy code to Netlify or when people visit the site? Seemingly if there’s 1M invocations, it couldn’t possibly be on deploy. If it’s on visit, is it running every time any user visits any page? And if so, I’m certainly not getting 1M visitors. Does each visit run tens of thousands of edge functions? Thanks in advance.
Also, is there a way to disable this setting? Is it something necessary to deploy svelte to Netlify?
You’re using SvelteKit with Netlify Edge Functions adapter. Thus, the issue. It runs on every request. I don’t think that’s the default adapter, (unless SvelteKit changed this recently) so it’s most likely something you’ve manually opted into. Read more about Edge Functions here: Edge Functions overview | Netlify Docs
thousand visitors is typically a large amount of users . users can spam requests too if u don’t restrict them . so technically u will reach 1m requests faster
Thanks for the reply! If I use the auto adapter, will the site still work? I don’t have a backend in that I don’t have a db or auth or signin, but I do have some code inside <script context="module">
tags.
What type of requests are they making? Is it just page views? Also, how would I restrict them? Thanks!
I don’t know your site or code, so I can’t say. That’s something for you to try out. If you’re building a static site, you should try using SvelteKit in static mode (I believe there’s a static adapter for that).