77import au .org .aodn .ogcapi .server .core .util .GeometryUtils ;
88import org .ehcache .config .builders .*;
99import org .ehcache .config .units .MemoryUnit ;
10+ import org .ehcache .impl .config .persistence .DefaultPersistenceConfiguration ;
1011import org .ehcache .jsr107 .EhcacheCachingProvider ;
1112import org .locationtech .jts .geom .Geometry ;
1213import org .locationtech .jts .geom .prep .PreparedGeometry ;
1920import javax .cache .Caching ;
2021import java .io .File ;
2122import java .io .IOException ;
23+ import java .math .BigInteger ;
2224import java .nio .file .Files ;
2325import java .nio .file .Path ;
2426import java .time .Duration ;
@@ -31,7 +33,10 @@ public class CacheConfig {
3133 public static final String CACHE_WMS_MAP_TILE = "cache-wms-map_tile" ;
3234 public static final String GET_CAPABILITIES_WMS_LAYERS = "get-capabilities-wms-layers" ;
3335 public static final String GET_CAPABILITIES_WFS_FEATURE_TYPES = "get-capabilities-wfs-feature-types" ;
36+
3437 public static final String DOWNLOADABLE_FIELDS = "downloadable-fields" ;
38+ public static final String DOWNLOADABLE_SIZE = "downloadable-size" ;
39+
3540 public static final String ALL_NO_LAND_GEOMETRY = "all-noland-geometry" ;
3641 public static final String ALL_PARAM_VOCABS = "parameter-vocabs" ;
3742 public static final String ELASTIC_SEARCH_UUID_ONLY = "elastic-search-uuid-only" ;
@@ -53,7 +58,7 @@ public JCacheCacheManager cacheManager() throws IOException {
5358
5459 org .ehcache .config .Configuration config = ConfigurationBuilder
5560 .newConfigurationBuilder ()
56- .withService (new org . ehcache . impl . config . persistence . DefaultPersistenceConfiguration (storagePath ))
61+ .withService (new DefaultPersistenceConfiguration (storagePath ))
5762 .withCache (CACHE_WMS_MAP_TILE ,
5863 CacheConfigurationBuilder .newCacheConfigurationBuilder (
5964 Object .class , byte [].class ,
@@ -81,6 +86,12 @@ public JCacheCacheManager cacheManager() throws IOException {
8186 ResourcePoolsBuilder .heap (200 )
8287 ).withExpiry (ExpiryPolicyBuilder .timeToLiveExpiration (Duration .ofHours (24 )))
8388 )
89+ .withCache (DOWNLOADABLE_SIZE ,
90+ CacheConfigurationBuilder .newCacheConfigurationBuilder (
91+ Object .class , BigInteger .class ,
92+ ResourcePoolsBuilder .heap (100 )
93+ ).withExpiry (ExpiryPolicyBuilder .timeToLiveExpiration (Duration .ofHours (24 )))
94+ )
8495 .withCache (ELASTIC_SEARCH_UUID_ONLY ,
8596 CacheConfigurationBuilder .newCacheConfigurationBuilder (
8697 Object .class , Object .class ,
0 commit comments