tiled.client.cache.Cache.in_memory

classmethod Cache.in_memory(capacity, *, scorer=None)[source]

An in-memory cache of data from the server

This is useful to ensure that data is not downloaded repeatedly unless it has been updated since the last download.

Because it is in memory, it only applies to a given Python process, i.e. a given working session. See Cache.on_disk() for a cache that can be shared across process and persistent for future sessions.

Parameters
capacityinteger

e.g. 2e9 to use up to 2 GB of RAM

scorerScorer

Determines which items to evict from the cache when it grows full. See tiled.client.cache.Scorer for example.