Understanding rate limit and site visits

Hello!
I would like to make a fortune cookie game with fortunes customized for a videogame, and I would like to understand if I will be hitting rate limits or not.

I know there is a 4000 request rate limit. If I were to post a link to this website, and 5000 players clicked on it, do I understand correctly that it would exceed rate limit?

Is 1 request equal to 1 site visit, 1 hosting request (i.e. the picture is hosted on Glitch servers therefore it is 1 request)? If the images are hosted on another server, and I simply add links to them, will there still be a request? Does loading the html page, the .js, .css equal a request?

Thank you in advance and please be patient with me I am not a web designer :c

if the request limit is, for example, 5000 per SECOND, that means that the website will give an error if more than 5000 requests have been made in that second

Well, that’s the thing - what exactly counts as a request? If I click on the link, is that a request? Does loading a picture hosted on a non-Glitch server count as a request?

A request is anything that requires sending a network request to the server. And note that it’s not 4000 requests per second, the standard rate limit is 4000 requests per hour.

Also note that this rate limit only applies to free accounts, Glitch Pro account projects are not rate limited in this way.

The rate limit is applied on all requests, so not just “the webpage”: if your pages include things like CSS or JavaScript files, and you host those in your project, then those will be separate requests, and are counted towards the rate limit (although browsers cache those kind of files, so they won’t ask for them every single time someone loads your pages).

As for downloading a picture hosted on a non-Glitch server: that’s not a request to your own project’s server, so doesn’t count towards your rate limit. Your server never sees that request. This is why we have the asset manager for media assets: it puts your assets on a CDN that doesn’t have rate limiting and linking to their URLs will “bypass” your project’s server.

Now, 4000 requests per hour is super generous for a regular website, but not necessarily enough for a massively popular or viral website, and definitely not for a popular web-hosted game, so if you expect to have lots of concurrent users, consider getting a pro account. But also: don’t jump the gun, you can just run whatever you want to run on a free account first (provided you’re not abusing the platform of course), and only when you do get rate limited, upgrade to pro.

2 Likes