Class: AWSCDK::Lightsail::CfnDistribution::CacheBehaviorProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_distribution.rb

Overview

CacheBehavior is a property of the AWS::Lightsail::Distribution resource. It describes the default cache behavior of an Amazon Lightsail content delivery network (CDN) distribution.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(behavior: nil) ⇒ CacheBehaviorProperty

Returns a new instance of CacheBehaviorProperty.

Parameters:

  • behavior (String, nil) (defaults to: nil)

    The cache behavior of the distribution.



735
736
737
738
# File 'lightsail/cfn_distribution.rb', line 735

def initialize(behavior: nil)
  @behavior = behavior
  Jsii::Type.check_type(@behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "behavior") unless @behavior.nil?
end

Instance Attribute Details

#behaviorString? (readonly)

The cache behavior of the distribution.

The following cache behaviors can be specified:

  • cache - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content.
  • dont-cache - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serves only the content that is specified in the distribution’s CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.


749
750
751
# File 'lightsail/cfn_distribution.rb', line 749

def behavior
  @behavior
end

Class Method Details

.jsii_propertiesObject



751
752
753
754
755
# File 'lightsail/cfn_distribution.rb', line 751

def self.jsii_properties
  {
    :behavior => "behavior",
  }
end

Instance Method Details

#to_jsiiObject



757
758
759
760
761
762
763
# File 'lightsail/cfn_distribution.rb', line 757

def to_jsii
  result = {}
  result.merge!({
    "behavior" => @behavior,
  })
  result.compact
end