Class CacheConfiguration
java.lang.Object
com.azure.resourcemanager.cdn.models.CacheConfiguration
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CacheConfiguration>
public final class CacheConfiguration
extends Object
implements com.azure.json.JsonSerializable<CacheConfiguration>
Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the cacheBehavior property: Caching behavior for the requests.Get the cacheDuration property: The duration for which the content needs to be cached.static CacheConfigurationfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CacheConfiguration from the JsonReader.Get the isCompressionEnabled property: Indicates whether content compression is enabled.Get the queryParameters property: query parameters to include or exclude (comma separated).Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withCacheBehavior(RuleCacheBehavior cacheBehavior) Set the cacheBehavior property: Caching behavior for the requests.withCacheDuration(String cacheDuration) Set the cacheDuration property: The duration for which the content needs to be cached.withIsCompressionEnabled(RuleIsCompressionEnabled isCompressionEnabled) Set the isCompressionEnabled property: Indicates whether content compression is enabled.withQueryParameters(String queryParameters) Set the queryParameters property: query parameters to include or exclude (comma separated).withQueryStringCachingBehavior(RuleQueryStringCachingBehavior queryStringCachingBehavior) Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CacheConfiguration
public CacheConfiguration()Creates an instance of CacheConfiguration class.
-
-
Method Details
-
queryStringCachingBehavior
Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique URL, or cache specific query strings.- Returns:
- the queryStringCachingBehavior value.
-
withQueryStringCachingBehavior
public CacheConfiguration withQueryStringCachingBehavior(RuleQueryStringCachingBehavior queryStringCachingBehavior) Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique URL, or cache specific query strings.- Parameters:
queryStringCachingBehavior- the queryStringCachingBehavior value to set.- Returns:
- the CacheConfiguration object itself.
-
queryParameters
Get the queryParameters property: query parameters to include or exclude (comma separated).- Returns:
- the queryParameters value.
-
withQueryParameters
Set the queryParameters property: query parameters to include or exclude (comma separated).- Parameters:
queryParameters- the queryParameters value to set.- Returns:
- the CacheConfiguration object itself.
-
isCompressionEnabled
Get the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.- Returns:
- the isCompressionEnabled value.
-
withIsCompressionEnabled
Set the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.- Parameters:
isCompressionEnabled- the isCompressionEnabled value to set.- Returns:
- the CacheConfiguration object itself.
-
cacheBehavior
Get the cacheBehavior property: Caching behavior for the requests.- Returns:
- the cacheBehavior value.
-
withCacheBehavior
Set the cacheBehavior property: Caching behavior for the requests.- Parameters:
cacheBehavior- the cacheBehavior value to set.- Returns:
- the CacheConfiguration object itself.
-
cacheDuration
Get the cacheDuration property: The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss.- Returns:
- the cacheDuration value.
-
withCacheDuration
Set the cacheDuration property: The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss.- Parameters:
cacheDuration- the cacheDuration value to set.- Returns:
- the CacheConfiguration object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CacheConfiguration>- Throws:
IOException
-
fromJson
Reads an instance of CacheConfiguration from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CacheConfiguration if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the CacheConfiguration.
-