#[non_exhaustive]pub struct ParametersInCacheKeyAndForwardedToOrigin {
pub enable_accept_encoding_gzip: bool,
pub enable_accept_encoding_brotli: Option<bool>,
pub headers_config: Option<CachePolicyHeadersConfig>,
pub cookies_config: Option<CachePolicyCookiesConfig>,
pub query_strings_config: Option<CachePolicyQueryStringsConfig>,
}
Expand description
This object determines the values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.
The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find an object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy
.
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.enable_accept_encoding_gzip: bool
A flag that can affect whether the Accept-Encoding
HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
This field is related to the EnableAcceptEncodingBrotli
field. If one or both of these fields is true
and the viewer request includes the Accept-Encoding
header, then CloudFront does the following:
-
Normalizes the value of the viewer's
Accept-Encoding
header -
Includes the normalized header in the cache key
-
Includes the normalized header in the request to the origin, if a request is necessary
For more information, see Compression support in the Amazon CloudFront Developer Guide.
If you set this value to true
, and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding
header in the origin request policy. CloudFront always includes the Accept-Encoding
header in origin requests when the value of this field is true
, so including this header in an origin request policy has no effect.
If both of these fields are false
, then CloudFront treats the Accept-Encoding
header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add Accept-Encoding
to the headers whitelist like any other HTTP header.
enable_accept_encoding_brotli: Option<bool>
A flag that can affect whether the Accept-Encoding
HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
This field is related to the EnableAcceptEncodingGzip
field. If one or both of these fields is true
and the viewer request includes the Accept-Encoding
header, then CloudFront does the following:
-
Normalizes the value of the viewer's
Accept-Encoding
header -
Includes the normalized header in the cache key
-
Includes the normalized header in the request to the origin, if a request is necessary
For more information, see Compression support in the Amazon CloudFront Developer Guide.
If you set this value to true
, and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding
header in the origin request policy. CloudFront always includes the Accept-Encoding
header in origin requests when the value of this field is true
, so including this header in an origin request policy has no effect.
If both of these fields are false
, then CloudFront treats the Accept-Encoding
header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add Accept-Encoding
to the headers whitelist like any other HTTP header.
headers_config: Option<CachePolicyHeadersConfig>
An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.
An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the cache key and in requests that CloudFront sends to the origin.
query_strings_config: Option<CachePolicyQueryStringsConfig>
An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and in requests that CloudFront sends to the origin.
Implementations§
Source§impl ParametersInCacheKeyAndForwardedToOrigin
impl ParametersInCacheKeyAndForwardedToOrigin
Sourcepub fn enable_accept_encoding_gzip(&self) -> bool
pub fn enable_accept_encoding_gzip(&self) -> bool
A flag that can affect whether the Accept-Encoding
HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
This field is related to the EnableAcceptEncodingBrotli
field. If one or both of these fields is true
and the viewer request includes the Accept-Encoding
header, then CloudFront does the following:
-
Normalizes the value of the viewer's
Accept-Encoding
header -
Includes the normalized header in the cache key
-
Includes the normalized header in the request to the origin, if a request is necessary
For more information, see Compression support in the Amazon CloudFront Developer Guide.
If you set this value to true
, and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding
header in the origin request policy. CloudFront always includes the Accept-Encoding
header in origin requests when the value of this field is true
, so including this header in an origin request policy has no effect.
If both of these fields are false
, then CloudFront treats the Accept-Encoding
header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add Accept-Encoding
to the headers whitelist like any other HTTP header.
Sourcepub fn enable_accept_encoding_brotli(&self) -> Option<bool>
pub fn enable_accept_encoding_brotli(&self) -> Option<bool>
A flag that can affect whether the Accept-Encoding
HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
This field is related to the EnableAcceptEncodingGzip
field. If one or both of these fields is true
and the viewer request includes the Accept-Encoding
header, then CloudFront does the following:
-
Normalizes the value of the viewer's
Accept-Encoding
header -
Includes the normalized header in the cache key
-
Includes the normalized header in the request to the origin, if a request is necessary
For more information, see Compression support in the Amazon CloudFront Developer Guide.
If you set this value to true
, and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding
header in the origin request policy. CloudFront always includes the Accept-Encoding
header in origin requests when the value of this field is true
, so including this header in an origin request policy has no effect.
If both of these fields are false
, then CloudFront treats the Accept-Encoding
header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add Accept-Encoding
to the headers whitelist like any other HTTP header.
Sourcepub fn headers_config(&self) -> Option<&CachePolicyHeadersConfig>
pub fn headers_config(&self) -> Option<&CachePolicyHeadersConfig>
An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.
An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the cache key and in requests that CloudFront sends to the origin.
Sourcepub fn query_strings_config(&self) -> Option<&CachePolicyQueryStringsConfig>
pub fn query_strings_config(&self) -> Option<&CachePolicyQueryStringsConfig>
An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and in requests that CloudFront sends to the origin.
Source§impl ParametersInCacheKeyAndForwardedToOrigin
impl ParametersInCacheKeyAndForwardedToOrigin
Sourcepub fn builder() -> ParametersInCacheKeyAndForwardedToOriginBuilder
pub fn builder() -> ParametersInCacheKeyAndForwardedToOriginBuilder
Creates a new builder-style object to manufacture ParametersInCacheKeyAndForwardedToOrigin
.
Trait Implementations§
Source§impl Clone for ParametersInCacheKeyAndForwardedToOrigin
impl Clone for ParametersInCacheKeyAndForwardedToOrigin
Source§fn clone(&self) -> ParametersInCacheKeyAndForwardedToOrigin
fn clone(&self) -> ParametersInCacheKeyAndForwardedToOrigin
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl PartialEq for ParametersInCacheKeyAndForwardedToOrigin
impl PartialEq for ParametersInCacheKeyAndForwardedToOrigin
Source§fn eq(&self, other: &ParametersInCacheKeyAndForwardedToOrigin) -> bool
fn eq(&self, other: &ParametersInCacheKeyAndForwardedToOrigin) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ParametersInCacheKeyAndForwardedToOrigin
Auto Trait Implementations§
impl Freeze for ParametersInCacheKeyAndForwardedToOrigin
impl RefUnwindSafe for ParametersInCacheKeyAndForwardedToOrigin
impl Send for ParametersInCacheKeyAndForwardedToOrigin
impl Sync for ParametersInCacheKeyAndForwardedToOrigin
impl Unpin for ParametersInCacheKeyAndForwardedToOrigin
impl UnwindSafe for ParametersInCacheKeyAndForwardedToOrigin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);