@ThreadSafe public final class ResponseHelperSettings extends Object
ResponseHelper class.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_EXPIRATION_SECONDS
Expires in at least 2 days (which is the minimum to be accepted for real
caching in Yahoo Guidelines).
|
static boolean |
DEFAULT_RESPONSE_COMPRESSION_ENABLED |
static boolean |
DEFAULT_RESPONSE_DERFLATE_ENABLED |
static boolean |
DEFAULT_RESPONSE_GZIP_ENABLED |
static LocalDateTime |
EXPIRES_NEVER_DATETIME
A special date that never expires
|
static String |
EXPIRES_NEVER_STRING
The string representation of never expires date
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getExpirationSeconds() |
static boolean |
isResponseCompressionEnabled() |
static boolean |
isResponseDeflateEnabled() |
static boolean |
isResponseGzipEnabled() |
static com.helger.commons.state.EChange |
setAll(boolean bResponseCompressionEnabled,
boolean bResponseGzipEnabled,
boolean bResponseDeflateEnabled)
Set all parameters at once as an atomic transaction
|
static com.helger.commons.state.EChange |
setExpirationSeconds(int nExpirationSeconds)
Set the default expiration settings to be used for objects that should use
HTTP caching
|
static com.helger.commons.state.EChange |
setResponseCompressionEnabled(boolean bResponseCompressionEnabled)
Enable or disable the overall compression.
|
static com.helger.commons.state.EChange |
setResponseDeflateEnabled(boolean bResponseDeflateEnabled)
Enable or disable Deflate compression.
|
static com.helger.commons.state.EChange |
setResponseGzipEnabled(boolean bResponseGzipEnabled)
Enable or disable Gzip compression.
|
public static final LocalDateTime EXPIRES_NEVER_DATETIME
public static final String EXPIRES_NEVER_STRING
public static final int DEFAULT_EXPIRATION_SECONDS
public static final boolean DEFAULT_RESPONSE_COMPRESSION_ENABLED
public static final boolean DEFAULT_RESPONSE_GZIP_ENABLED
public static final boolean DEFAULT_RESPONSE_DERFLATE_ENABLED
@Nonnull public static com.helger.commons.state.EChange setResponseCompressionEnabled(boolean bResponseCompressionEnabled)
bResponseCompressionEnabled - true to enable it, false to disable itEChangepublic static boolean isResponseCompressionEnabled()
true if overall compression is enabled,
false if not@Nonnull public static com.helger.commons.state.EChange setResponseGzipEnabled(boolean bResponseGzipEnabled)
isResponseCompressionEnabled() is truebResponseGzipEnabled - true to enable it, false to disable itEChangepublic static boolean isResponseGzipEnabled()
true if GZip compression is enabled,
false if not@Nonnull public static com.helger.commons.state.EChange setResponseDeflateEnabled(boolean bResponseDeflateEnabled)
isResponseCompressionEnabled() is truebResponseDeflateEnabled - true to enable it, false to disable itEChangepublic static boolean isResponseDeflateEnabled()
true if Deflate compression is enabled,
false if not@Nonnull public static com.helger.commons.state.EChange setAll(boolean bResponseCompressionEnabled, boolean bResponseGzipEnabled, boolean bResponseDeflateEnabled)
bResponseCompressionEnabled - true to overall enable the usagebResponseGzipEnabled - true to enable GZip if compression is enabledbResponseDeflateEnabled - true to enable Deflate if compression is enabledEChange@Nonnull public static com.helger.commons.state.EChange setExpirationSeconds(int nExpirationSeconds)
nExpirationSeconds - The number of seconds for which the response should be cachedEChangepublic static int getExpirationSeconds()
Copyright © 2016–2019 Philip Helger. All rights reserved.