Class: Google::Apis::ComputeBeta::CachePolicy
- Inherits:
-
Object
- Object
- Google::Apis::ComputeBeta::CachePolicy
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/compute_beta/classes.rb,
lib/google/apis/compute_beta/representations.rb,
lib/google/apis/compute_beta/representations.rb
Overview
Message containing CachePolicy configuration for URL Map's Route Action.
Instance Attribute Summary collapse
-
#cache_bypass_request_header_names ⇒ Array<String>
Bypass the cache when the specified request headers are matched by name, e.g.
-
#cache_key_policy ⇒ Google::Apis::ComputeBeta::CachePolicyCacheKeyPolicy
Message containing what to include in the cache key for a request for Cache Policy defined on Route Action.
-
#cache_mode ⇒ String
Specifies the cache setting for all responses from this route.
-
#client_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
-
#default_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
-
#max_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
-
#negative_caching ⇒ Boolean
(also: #negative_caching?)
Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects.
-
#negative_caching_policy ⇒ Array<Google::Apis::ComputeBeta::CachePolicyNegativeCachingPolicy>
Sets a cache TTL for the specified HTTP status code.
-
#request_coalescing ⇒ Boolean
(also: #request_coalescing?)
If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin.
-
#serve_while_stale ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CachePolicy
constructor
A new instance of CachePolicy.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ CachePolicy
Returns a new instance of CachePolicy.
7668 7669 7670 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7668 def initialize(**args) update!(**args) end |
Instance Attribute Details
#cache_bypass_request_header_names ⇒ Array<String>
Bypass the cache when the specified request headers are matched by name,
e.g. Pragma or Authorization headers. Values are case-insensitive. Up to 5
header names can be specified. The cache is bypassed for all
cachePolicy.cacheMode settings.
Corresponds to the JSON property cacheBypassRequestHeaderNames
7581 7582 7583 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7581 def cache_bypass_request_header_names @cache_bypass_request_header_names end |
#cache_key_policy ⇒ Google::Apis::ComputeBeta::CachePolicyCacheKeyPolicy
Message containing what to include in the cache key for a request for Cache
Policy defined on Route Action.
Corresponds to the JSON property cacheKeyPolicy
7587 7588 7589 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7587 def cache_key_policy @cache_key_policy end |
#cache_mode ⇒ String
Specifies the cache setting for all responses from this route.
If not specified, the default value is CACHE_ALL_STATIC.
Corresponds to the JSON property cacheMode
7593 7594 7595 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7593 def cache_mode @cache_mode end |
#client_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented
as a count of seconds and fractions of seconds at nanosecond
resolution. It is independent of any calendar and concepts like "day"
or "month". Range is approximately 10,000 years.
Corresponds to the JSON property clientTtl
7601 7602 7603 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7601 def client_ttl @client_ttl end |
#default_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented
as a count of seconds and fractions of seconds at nanosecond
resolution. It is independent of any calendar and concepts like "day"
or "month". Range is approximately 10,000 years.
Corresponds to the JSON property defaultTtl
7609 7610 7611 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7609 def default_ttl @default_ttl end |
#max_ttl ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented
as a count of seconds and fractions of seconds at nanosecond
resolution. It is independent of any calendar and concepts like "day"
or "month". Range is approximately 10,000 years.
Corresponds to the JSON property maxTtl
7617 7618 7619 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7617 def max_ttl @max_ttl end |
#negative_caching ⇒ Boolean Also known as: negative_caching?
Negative caching allows per-status code TTLs to be set, in order
to apply fine-grained caching for common errors or redirects.
This can reduce the load on your origin and improve end-user
experience by reducing response latency.
When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS,
negative caching applies to responses with the specified response code
that lack any Cache-Control, Expires, or Pragma: no-cache directives.
When the cache mode is set to FORCE_CACHE_ALL, negative caching applies
to all responses with the specified response code, and override any
caching headers.
By default, Cloud CDN will apply the following default TTLs to these
status codes:
HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m
HTTP 404 (Not Found), 410 (Gone),
451 (Unavailable For Legal Reasons): 120s
HTTP 405 (Method Not Found), 501 (Not Implemented): 60s.
These defaults can be overridden in negative_caching_policy.
Corresponds to the JSON property negativeCaching
7638 7639 7640 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7638 def negative_caching @negative_caching end |
#negative_caching_policy ⇒ Array<Google::Apis::ComputeBeta::CachePolicyNegativeCachingPolicy>
Sets a cache TTL for the specified HTTP status code.
negative_caching must be enabled to configure negative_caching_policy.
Omitting the policy and leaving negative_caching enabled will use
Cloud CDN's default cache TTLs.
Note that when specifying an explicit negative_caching_policy, you
should take care to specify a cache TTL for all response codes
that you wish to cache. Cloud CDN will not apply any default
negative caching when a policy exists.
Corresponds to the JSON property negativeCachingPolicy
7651 7652 7653 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7651 def negative_caching_policy @negative_caching_policy end |
#request_coalescing ⇒ Boolean Also known as: request_coalescing?
If true then Cloud CDN will combine multiple concurrent cache fill
requests into a small number of requests to the origin.
Corresponds to the JSON property requestCoalescing
7657 7658 7659 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7657 def request_coalescing @request_coalescing end |
#serve_while_stale ⇒ Google::Apis::ComputeBeta::Duration
A Duration represents a fixed-length span of time represented
as a count of seconds and fractions of seconds at nanosecond
resolution. It is independent of any calendar and concepts like "day"
or "month". Range is approximately 10,000 years.
Corresponds to the JSON property serveWhileStale
7666 7667 7668 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7666 def serve_while_stale @serve_while_stale end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 |
# File 'lib/google/apis/compute_beta/classes.rb', line 7673 def update!(**args) @cache_bypass_request_header_names = args[:cache_bypass_request_header_names] if args.key?(:cache_bypass_request_header_names) @cache_key_policy = args[:cache_key_policy] if args.key?(:cache_key_policy) @cache_mode = args[:cache_mode] if args.key?(:cache_mode) @client_ttl = args[:client_ttl] if args.key?(:client_ttl) @default_ttl = args[:default_ttl] if args.key?(:default_ttl) @max_ttl = args[:max_ttl] if args.key?(:max_ttl) @negative_caching = args[:negative_caching] if args.key?(:negative_caching) @negative_caching_policy = args[:negative_caching_policy] if args.key?(:negative_caching_policy) @request_coalescing = args[:request_coalescing] if args.key?(:request_coalescing) @serve_while_stale = args[:serve_while_stale] if args.key?(:serve_while_stale) end |