Package com.linecorp.armeria.common
Class ClientCacheControlBuilder
java.lang.Object
com.linecorp.armeria.common.ClientCacheControlBuilder
Creates a new
ClientCacheControl
using the builder pattern.
ClientCacheControl cacheControl =
ClientCacheControl.builder().noCache().build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newly createdClientCacheControl
with the directives enabled so far.Enables or disables the"max-age"
directive.maxAgeSeconds
(long maxAgeSeconds) Enables the"max-age"
directive.maxStale()
Enables the"max-stale
directive without a value.maxStale
(boolean maxStale) Enables or disables the"max-stale"
directive.Enables or disables the"max-stale"
directive.maxStaleSeconds
(long maxStaleSeconds) Enables the"max-stale"
directive.Enables or disables the"min-fresh"
directive.minFreshSeconds
(long minFreshSeconds) Enables the"min-fresh"
directive.noCache()
Enables the"no-cache"
directive.noCache
(boolean noCache) Enables or disables the"no-cache"
directive.noStore()
Enables the"no-store"
directive.noStore
(boolean noStore) Enables or disables the"no-store"
directive.Enables the"no-transform"
directive.noTransform
(boolean noTransform) Enables or disables the"no-transform"
directive.Enables the"only-if-cached"
directive.onlyIfCached
(boolean onlyIfCached) Enables or disables the"only-if-cached"
directive.staleIfError
(@Nullable Duration staleIfError) Enables or disables the"stale-if-error"
directive.staleIfErrorSeconds
(long staleIfErrorSeconds) Enables the"stale-if-error"
directive.staleWhileRevalidate
(@Nullable Duration staleWhileRevalidate) Enables or disables the"stale-while-revalidate"
directive.staleWhileRevalidateSeconds
(long staleWhileRevalidateSeconds) Enables the"stale-while-revalidate"
directive.
-
Method Details
-
onlyIfCached
Enables the"only-if-cached"
directive. -
onlyIfCached
Enables or disables the"only-if-cached"
directive.- Parameters:
onlyIfCached
-true
to enable orfalse
to disable.
-
maxStale
Enables the"max-stale
directive without a value. -
maxStale
Enables or disables the"max-stale"
directive.- Parameters:
maxStale
-true
to enable without a value orfalse
to disable.
-
maxStale
Enables or disables the"max-stale"
directive.- Parameters:
maxStale
- the value of the directive to enable, ornull
to disable.
-
maxStaleSeconds
Enables the"max-stale"
directive.- Parameters:
maxStaleSeconds
- the value in seconds.
-
minFresh
Enables or disables the"min-fresh"
directive.- Parameters:
minFresh
- the value of the directive to enable, ornull
to disable.
-
minFreshSeconds
Enables the"min-fresh"
directive.- Parameters:
minFreshSeconds
- the value in seconds.
-
staleWhileRevalidate
public ClientCacheControlBuilder staleWhileRevalidate(@Nullable @Nullable Duration staleWhileRevalidate) Enables or disables the"stale-while-revalidate"
directive.- Parameters:
staleWhileRevalidate
- the value of the directive to enable, ornull
to disable.
-
staleWhileRevalidateSeconds
Enables the"stale-while-revalidate"
directive.- Parameters:
staleWhileRevalidateSeconds
- the value in seconds.
-
staleIfError
Enables or disables the"stale-if-error"
directive.- Parameters:
staleIfError
- the value of the directive to enable, ornull
to disable.
-
staleIfErrorSeconds
Enables the"stale-if-error"
directive.- Parameters:
staleIfErrorSeconds
- the value in seconds.
-
build
Returns a newly createdClientCacheControl
with the directives enabled so far. -
noCache
Enables the"no-cache"
directive. -
noCache
Enables or disables the"no-cache"
directive.- Parameters:
noCache
-true
to enable orfalse
to disable.
-
noStore
Enables the"no-store"
directive. -
noStore
Enables or disables the"no-store"
directive.- Parameters:
noStore
-true
to enable orfalse
to disable.
-
noTransform
Enables the"no-transform"
directive. -
noTransform
Enables or disables the"no-transform"
directive.- Parameters:
noTransform
-true
to enable orfalse
to disable.
-
maxAge
Enables or disables the"max-age"
directive.- Parameters:
maxAge
- the value of the directive to enable, ornull
to disable.
-
maxAgeSeconds
Enables the"max-age"
directive.- Parameters:
maxAgeSeconds
- the value in seconds.
-