Interface MemoryCacheConfig
- All Superinterfaces:
Prototype.Api,Prototype.Factory<MemoryCache>
- All Known Implementing Classes:
MemoryCacheConfig.BuilderBase.MemoryCacheConfigImpl
Configuration of memory cache for static content.
The memory cache will cache the first
bytes that fit into the configured memory size for the
duration of the service uptime.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forMemoryCache.static classMemoryCacheConfig.BuilderBase<BUILDER extends MemoryCacheConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends MemoryCacheConfig> Fluent API builder base forMemoryCache. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryCacheConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static MemoryCacheConfig.Builderbuilder(MemoryCacheConfig instance) Create a new fluent API builder from an existing instance.capacity()Capacity of the cached bytes of file content.static MemoryCacheConfigcreate()Create a new instance with default values.static MemoryCacheConfigDeprecated.static MemoryCacheConfigCreate a new instance from configuration.booleanenabled()Whether the cache is enabled, defaults totrue.Methods inherited from interface io.helidon.builder.api.Prototype.Factory
build
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Deprecated.Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
enabled
boolean enabled()Whether the cache is enabled, defaults totrue.- Returns:
- whether the cache is enabled
-
capacity
Size capacity()Capacity of the cached bytes of file content. If set to0, the cache is unlimited. To disable caching, setenabled()tofalse, or do not configure a memory cache at all.The capacity must be less than
Long.MAX_VALUEbytes, though you must be careful still, as it must fit into the heap size.- Returns:
- capacity of the cache in bytes, defaults to 50 million bytes (50 mB)
-
create(io.helidon.config.Config)