istornz / iPokeGo

A native iOS client to map the Pokemon around you!
https://github.com/RocketMap/RocketMap
MIT License
642 stars 168 forks source link

Cache or store images locally #197

Open MysticalOS opened 8 years ago

MysticalOS commented 8 years ago

I noticed that using map yesterday it used 1 gig of data. Yes that much on downloading pokemon images over and over and over again in a city that had 100s of them. this can be avoided by simply storing the images locally either cached once downloaded one or just including them with app to begin with. the only thing app should need to actually download is the data from server which is mostly text parsing. As for the map itself I don't think that used most of data either but could probably cache that a little better too.

Ultimately the issue here is that app uses entirely way too much data.

istornz commented 8 years ago

This app only download a JSON file every 5sec. Images are stored localy

MysticalOS commented 8 years ago

It used up one gig doing that? it doesn't reload map from google over and over? it's loading something big frequently.

markvl91 commented 8 years ago

If you're scanning a large area the JSON file can be quite large. Not near my development pc right now, but I've seen my requests reach a megabyte easily with pokestops included. Combine that with leaving the app running in the background (1 request per 20 seconds, instead of 5 seconds) adds up really fast.

On 9 aug. 2016, at 21:31, Adam notifications@github.com wrote:

It used up one gig doing that? it doesn't reload map from google over and over? it's loading something big frequently.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

parrots commented 8 years ago

Depends on how much data your server is sending back, if GZIP is enabled on the server, etc.

For example my server is set to cover an entire city, so my JSON returns are much larger than someone with one scan worker going. It doesn't just send back data for where you are viewing - it's all the data the server has. When this is happening every 5 seconds, even a 5k JSON payload would hit 42megs in 12 hours. Generally the JSON is much larger than that.

The maps aren't reloaded that often (that's all behind the scenes Apple logic), but it is a vector-based map so even if it was the data wouldn't be a lot. It isn't like this is using satellite maps.

MysticalOS commented 8 years ago

Fair enough. guess next question. Maybe option to change frequency to higher number. I'd be ok with a 20-30 second delay. it'll mean slower notifications but i don't think 30 seconds will make or break it. if I'm not near the spawn I miss out anyways :)