brendaninnis / satle

Satle is a Wordle-like daily geography game where you guess cities based on satellite images.
https://satle.brendaninnis.ca
5 stars 1 forks source link

Reduce API costs #7

Open novedevo opened 11 months ago

novedevo commented 11 months ago

Hi! Love your game. I saw the "Google Maps API is expensive 😟" message and thought I might be able to help. I know the API is pricey, especially when loading it live for every viewer. However, since every user gets the same location each day, and they're chosen from a set list, you can avoid using the API client-side at all. You could preload the 6 zoom levels for each of the 301 cities; 1806 images in total. Or, if you'd rather not store ~1.8GB of images (though I think many cloud providers will host that for you at minimal cost, and it fits within a Nanode), you could just preload each day's images in advance serverside, or on demand...

These changes could turn it from a client-side-only bundle of JS into something with a serverside component, which I understand might not be something you'd want to do. But I just thought I'd mention it, in case the API costs are significant!

thanks for making satle ❤️

brendaninnis commented 11 months ago

Wow that’s a great idea!! I’m certainly going to have to look into that.Thanks so much for the feedback and for enjoying Satle.Cheers 🥂 BrendanOn Dec 7, 2023, at 11:05 AM, Devon Sawatsky @.***> wrote: Hi! Love your game. I saw the "Google Maps API is expensive 😟" message and thought I might be able to help. I know the API is pricey, especially when loading it live for every viewer. However, since every user gets the same location each day, and they're chosen from a set list, you can avoid using the API client-side at all. You could preload the 6 zoom levels for each of the 301 cities; 1806 images in total. Or, if you'd rather not store ~1.8GB of images (though I think many cloud providers will host that for you at minimal cost, and it fits within a Nanode), you could just preload each day's images in advance serverside, or on demand... These changes could turn it from a client-side-only bundle of JS into something with a serverside component, which I understand might not be something you'd want to do. But I just thought I'd mention it, in case the API costs are significant! thanks for making satle ❤️

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>