resolveStaticFilesCacheMaxMemorySize static method

int resolveStaticFilesCacheMaxMemorySize(
  1. int? max, {
  2. APIConfig? apiConfig,
})

Implementation

static int resolveStaticFilesCacheMaxMemorySize(int? max,
    {APIConfig? apiConfig}) {
  if (max != null) return max;

  if (apiConfig != null) {
    max ??= apiConfig.getAs('static-files-cache-max-memory-size');
    max ??= apiConfig.getAs('static_files_cache_max_memory_size');
    max ??= apiConfig.getPath('cache', 'static_files', 'max_memory_size');
  }

  max ??= APIServerResponseCache.defaultMaxMemorySize;
  return max;
}