geodesic.boson.dataset.Dataset.set_cache_settings#
- Dataset.set_cache_settings(enable_persistence=False, ttl=None)[source]#
Configure the cache for this dataset.
Depending on how the request is made, Boson will cache results so that future requests can be made more performant. By default this is in two in memory tiers with with varying TTLs (under 5 minutes). This can be extended with long term caching on in the configured object store (e.g. Google Cloud Storage, S3, Azure Blob, etc.). This is particularly important when either caching very large datasets or slowly changing data that may take a long time to compute. For maximum performance, we recommend enabling the persistent cache for Datasets you intend to expose via (raster/vector) tile services.
- Parameters:
enable_persistence (bool) – whether to enable use of the object store for long term caching. This is particularly important when either caching very large datasets or slowly changing data that may take a long time to compute
ttl (timedelta | int | float | None) – the time to live for the cache in seconds. This is the maximum time that an object will be stored in the cache before it is evicted. If None, the cache will use Boson’s internal cache defaults.