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 Details

    • CacheConfiguration

      public CacheConfiguration()
      Creates an instance of CacheConfiguration class.
  • Method Details

    • queryStringCachingBehavior

      public RuleQueryStringCachingBehavior 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

      public String queryParameters()
      Get the queryParameters property: query parameters to include or exclude (comma separated).
      Returns:
      the queryParameters value.
    • withQueryParameters

      public CacheConfiguration withQueryParameters(String queryParameters)
      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

      public RuleIsCompressionEnabled 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

      public CacheConfiguration withIsCompressionEnabled(RuleIsCompressionEnabled isCompressionEnabled)
      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

      public RuleCacheBehavior cacheBehavior()
      Get the cacheBehavior property: Caching behavior for the requests.
      Returns:
      the cacheBehavior value.
    • withCacheBehavior

      public CacheConfiguration withCacheBehavior(RuleCacheBehavior cacheBehavior)
      Set the cacheBehavior property: Caching behavior for the requests.
      Parameters:
      cacheBehavior - the cacheBehavior value to set.
      Returns:
      the CacheConfiguration object itself.
    • cacheDuration

      public String 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

      public CacheConfiguration withCacheDuration(String cacheDuration)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<CacheConfiguration>
      Throws:
      IOException
    • fromJson

      public static CacheConfiguration fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.