Closed jonatkins closed 11 years ago
Well...a quick hello from Jamaica :) I am not able to test this even further, but I am pretty sure, that map tiles are already cached in android app storage cache. If I force-close the app, the visited (cached) tiles are loaded much faster on mobile connection and since the app was closed and restarted again, they can't be cached in RAM. From where do you have the info, that the tiles are stored in RAM instead of the app storage cache? If @fkloft won't do it before, I will have a look at it again in 10 days... Cheers
I don't mean the graphical map data tiles - they're cached just fine.
I'm talking about the ingress map data tiles - portals, links, fields, etc. And the evidence they're cached in RAM? I wrote the code - in code/map_data.js :)
So some kind of API to store these javascript data structures into the android cache is what I'm suggesting.
Ah ok got it. I can't check this atm, but will have a look at it when I'm back in Germany.
It may become less relevant if the request retry rewrite works well - #493 - as one use of the data cache is to improve things when the servers return lots of error==TIMEOUT tiles. So hold off doing any actual work on this until that task is complete.
OK, after some thoughts and experiments, I've decided it doesn't need to go beyond the in-RAM cache.
Originally, the cache was mainly a work-around for the server returning error==TIMEOUT occasionally. Now it does this, for some tiles, on nearly every request, so as of 0.14.0 IITC retries these requests (as the stock site has done for a while).
The RAM-only cache is still useful in the short term - while panning around the map to avoid loading tiles recently acquired - but no need to persist this as it expires within a minute or so.
Currently, the javascript maintains a map data tile cache in RAM, to reduce the number of network requests when panning/zooming, and help have data to display when requests fail. However, on mobile, this cache is lost when the app exits.
Having an API the javascript can use to access the android app cache would help greatly. This could be used instead of the in memory cache on mobile to reduce RAM usage too.