#[non_exhaustive]pub struct CachePolicyCacheKeyPolicy {
pub excluded_query_parameters: Vec<String>,
pub include_host: Option<bool>,
pub include_protocol: Option<bool>,
pub include_query_string: Option<bool>,
pub included_cookie_names: Vec<String>,
pub included_header_names: Vec<String>,
pub included_query_parameters: Vec<String>,
/* private fields */
}region-url-maps or url-maps only.Expand description
Message containing what to include in the cache key for a request for Cache Policy defined on Route Action.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.excluded_query_parameters: Vec<String>Names of query string parameters to exclude in cache keys. All other
parameters will be included. Either specify excludedQueryParameters
or includedQueryParameters, not both. ‘&’ and ‘=’ will be percent
encoded and not treated as delimiters.
Note: This field applies to routes that use backend services. Attempting
to set it on a route that points exclusively to Backend Buckets will
result in a configuration error. For routes that point to a Backend
Bucket, use includedQueryParameters to define which parameters should
be part of the cache key.
include_host: Option<bool>If true, requests to different hosts will be cached separately.
Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the host is never included in a Backend Bucket’s cache key. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error.
include_protocol: Option<bool>If true, http and https requests will be cached separately.
Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket, as the protocol is never included in a Backend Bucket’s cache key. Attempting to set on a route that points exclusively to Backend Buckets will result in a configuration error.
include_query_string: Option<bool>If true, include query string parameters in the cache key according to
includedQueryParameters and excludedQueryParameters. If neither
is set, the entire query string will be included. If false, the query
string will be excluded from the cache key entirely.
Note: This field applies to routes that use backend services. Attempting
to set it on a route that points exclusively to Backend Buckets will
result in a configuration error. For routes that point to a Backend
Bucket, use includedQueryParameters to define which parameters should
be part of the cache key.
Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.
Note: This setting is only applicable to routes that use a Backend Service. It does not affect requests served by a Backend Bucket. Attempting to set it on a route that points exclusively to Backend Buckets will result in a configuration error. Up to 5 cookie names can be specified.
included_header_names: Vec<String>Allows HTTP request headers (by name) to be used in the cache key.
included_query_parameters: Vec<String>Names of query string parameters to include in cache keys. All other
parameters will be excluded. Either specify includedQueryParameters
or excludedQueryParameters, not both. ‘&’ and ‘=’ will be percent
encoded and not treated as delimiters.
Implementations§
Source§impl CachePolicyCacheKeyPolicy
impl CachePolicyCacheKeyPolicy
Sourcepub fn set_excluded_query_parameters<T, V>(self, v: T) -> Self
pub fn set_excluded_query_parameters<T, V>(self, v: T) -> Self
Sets the value of excluded_query_parameters.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_excluded_query_parameters(["a", "b", "c"]);Sourcepub fn set_include_host<T>(self, v: T) -> Self
pub fn set_include_host<T>(self, v: T) -> Self
Sets the value of include_host.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_include_host(true);Sourcepub fn set_or_clear_include_host<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_include_host<T>(self, v: Option<T>) -> Self
Sets or clears the value of include_host.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_host(Some(false));
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_host(None::<bool>);Sourcepub fn set_include_protocol<T>(self, v: T) -> Self
pub fn set_include_protocol<T>(self, v: T) -> Self
Sets the value of include_protocol.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_include_protocol(true);Sourcepub fn set_or_clear_include_protocol<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_include_protocol<T>(self, v: Option<T>) -> Self
Sets or clears the value of include_protocol.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_protocol(Some(false));
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_protocol(None::<bool>);Sourcepub fn set_include_query_string<T>(self, v: T) -> Self
pub fn set_include_query_string<T>(self, v: T) -> Self
Sets the value of include_query_string.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_include_query_string(true);Sourcepub fn set_or_clear_include_query_string<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_include_query_string<T>(self, v: Option<T>) -> Self
Sets or clears the value of include_query_string.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_query_string(Some(false));
let x = CachePolicyCacheKeyPolicy::new().set_or_clear_include_query_string(None::<bool>);Sets the value of included_cookie_names.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_included_cookie_names(["a", "b", "c"]);Sourcepub fn set_included_header_names<T, V>(self, v: T) -> Self
pub fn set_included_header_names<T, V>(self, v: T) -> Self
Sets the value of included_header_names.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_included_header_names(["a", "b", "c"]);Sourcepub fn set_included_query_parameters<T, V>(self, v: T) -> Self
pub fn set_included_query_parameters<T, V>(self, v: T) -> Self
Sets the value of included_query_parameters.
§Example
let x = CachePolicyCacheKeyPolicy::new().set_included_query_parameters(["a", "b", "c"]);Trait Implementations§
Source§impl Clone for CachePolicyCacheKeyPolicy
impl Clone for CachePolicyCacheKeyPolicy
Source§fn clone(&self) -> CachePolicyCacheKeyPolicy
fn clone(&self) -> CachePolicyCacheKeyPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more