I’ll try to keep this short and still add all relevant information. First, I have looked both in a general online search (even though Google is basically useless for finding anything) and on this board, but I haven’t seen this question (maybe because the answer is obvious).
I got SB up and running on a Linux laptop, and set up Ngrok, and have been able to access SB from other computers on my network, and on my phone and from my work PC via the internet. However, I have blown through the limit of 20000 http requests in a couple of days and now I have to wait till October 1 before it resets.
Did I do something obviously wrong that sent an excessive number of requests? I accessed the pages several times trying different settings and working with style script, but I wouldn’t think I have reloaded a page more than 1,000 times, let alone 20,000.
Is there anything I can do to make sure this doesn’t happen again, or is this limit going to be a problem for regular use (meaning I need to explore options other than Ngrok)?
I am very much a novice and stumbling around half in the dark here. I have a general idea what an http request is, having set up a small local server on an RPi Pico, but there is a LOT more going here that I don’t understand. So please use the loud, slow English and small words.
I’m not familiar with how SB works in the backend so take this with a grain of salt. I’m guessing that to ensure everything is in sync between server and client, each action in the client will be sending one request (possibly multiple) to the server. Meaning that as you type, the request count will keep increasing. You said that you blew the limit in a few days, I don’t know if any adjustment you can do will be enough to keep within the limit for a full month.
In sync mode, data is always kept in sync as soon as the client is able to reach the server. To limit the quantity of request through ngrok you could try to:
Work in sync mode and block connection to SB in the firewall
Allow connections through the firewall once you want to trigger a sync
Make sure not to use ngrok on device within your home network.
However, this doesn’t seem like a viable alternative in the long term. So I think it would be best to explore alternative way of accessing your SB over the internet. Here a some suggestions to setup:
Keep SB server accessible on your home network only. Using sync mode while out. This is only viable if you bring your work PC home every day (or at least regularly).
Use a VPN to connect back to your home network and access SB over the internet. Tailscale is probably the easiest option to implement and there is a guide on using SB with Tailscale. It can also work without installing a VPN client on the machine which could be against company policy.
Get a domain name (cheap numbered.xyz domain are ~1USD/year) and point it to your home ip. For a novice, it can be quite an involved process to set it up but would work to access your SB over the internet.
If you are using Sync mode and have a large space, it will download all files locally on every device using at least 1 request per file. In addition to every save (that kicks after every edit, throttled about 1 save per ~2 seconds), on top of that there’s a poll every 5s even when in active to check if the currently open page has been changed on the server (and to reload it if it has). So this can all add up.
Honestly I wasn’t really aware ngrok had a limit like this, I only tried it briefly to see if it worked. I never used it day to day. Perhaps it’s not a great solution in a day-to-day setup, although I assume that paying for the service would remove such limits?
Thanks for the response. Getting a domain and setting it up myself was my first thought, but I know just enough about it to realize how much I don’t know, and my understanding is that it gets complicated trying to make it safe. But I’ll definitely dig deeper into that. And I’ll look at Tailscale. I’ve heard it mentioned but ruled it out as a VPN wasn’t what I was looking for, but if there are options to make it work without having to install anything it is definitely worth looking at.
Thank you for the reply. Yes, they have $18 per month pay-as-you-go plans and $10 per month single user/seat developer plans (or $8 if you pay for the whole year.) I’ll have to see how they handle the http request issue.