5 Commits

Author SHA1 Message Date
Jon Atkins
46275956cf data cache:
- reduce the expiry time (the niantic servers are no longer as unreliable as they were, so keeping old data is less useful than it once was)
- add upper size limit on cache, as well as item count limit
- add debug method to get cache size as a string
2015-02-22 17:00:18 +00:00
Jon Atkins
600fe1f91c experimental: JSON encode the data stored in the cache
in theory, keeping the javascript objects directly in the cache is a good thing. any instances of, for example, portals on the map, will share the data objects with those in the cache, limiting the overheads for cached items in use
however, in practice
- relatively large and complex data structures for cached data. and as some items expired from the cache may have data in live portals, etc, complex for garbage collection to clean up. strings, on the other hand - one single object to clean, zero references from anything else
- the cache is used as an alternative to network requests. therefore the extra time to encode/parse the strings is no real issue
- lower memory overheads? it's liekly a single string is more efficient on RAM use, even taking into account that some objects will be both encoded in the string, and duplicated in live entities on the map

time will tell if this is better or worse than direct object storage...
2015-02-21 23:32:57 +00:00
Jon Atkins
b58aff8a54 remove references to niantic variables in their 'nemesis.' object - not available since they introduced minification 2014-08-15 00:48:58 +01:00
Jon Atkins
f57d429b42 cache expiry time was 2 mins, but default intel site uses 3 minutes - mis-read their timer value 2014-02-21 07:30:40 +00:00
Jon Atkins
138a37d777 first attempt at loading portal details, and displaying in the sidebar once loaded 2013-12-01 00:08:25 +00:00