Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Creates a cache policy.
After you create a cache policy, you can attach it to one or more cache behaviors. When it’s attached to a cache behavior, the cache policy determines the following:
- 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 default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.
The headers, cookies, and query strings that are included in the cache
key are automatically 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
.
For more information about cache policies, see Controlling the cache key in the Amazon CloudFront Developer Guide.
Synopsis
- data CreateCachePolicy = CreateCachePolicy' {}
- newCreateCachePolicy :: CachePolicyConfig -> CreateCachePolicy
- createCachePolicy_cachePolicyConfig :: Lens' CreateCachePolicy CachePolicyConfig
- data CreateCachePolicyResponse = CreateCachePolicyResponse' {
- cachePolicy :: Maybe CachePolicy
- eTag :: Maybe Text
- location :: Maybe Text
- httpStatus :: Int
- newCreateCachePolicyResponse :: Int -> CreateCachePolicyResponse
- createCachePolicyResponse_cachePolicy :: Lens' CreateCachePolicyResponse (Maybe CachePolicy)
- createCachePolicyResponse_eTag :: Lens' CreateCachePolicyResponse (Maybe Text)
- createCachePolicyResponse_location :: Lens' CreateCachePolicyResponse (Maybe Text)
- createCachePolicyResponse_httpStatus :: Lens' CreateCachePolicyResponse Int
Creating a Request
data CreateCachePolicy Source #
See: newCreateCachePolicy
smart constructor.
CreateCachePolicy' | |
|
Instances
Create a value of CreateCachePolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:cachePolicyConfig:CreateCachePolicy'
, createCachePolicy_cachePolicyConfig
- A cache policy configuration.
Request Lenses
createCachePolicy_cachePolicyConfig :: Lens' CreateCachePolicy CachePolicyConfig Source #
A cache policy configuration.
Destructuring the Response
data CreateCachePolicyResponse Source #
See: newCreateCachePolicyResponse
smart constructor.
CreateCachePolicyResponse' | |
|
Instances
newCreateCachePolicyResponse Source #
Create a value of CreateCachePolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:cachePolicy:CreateCachePolicyResponse'
, createCachePolicyResponse_cachePolicy
- A cache policy.
$sel:eTag:CreateCachePolicyResponse'
, createCachePolicyResponse_eTag
- The current version of the cache policy.
$sel:location:CreateCachePolicyResponse'
, createCachePolicyResponse_location
- The fully qualified URI of the cache policy just created.
$sel:httpStatus:CreateCachePolicyResponse'
, createCachePolicyResponse_httpStatus
- The response's http status code.
Response Lenses
createCachePolicyResponse_cachePolicy :: Lens' CreateCachePolicyResponse (Maybe CachePolicy) Source #
A cache policy.
createCachePolicyResponse_eTag :: Lens' CreateCachePolicyResponse (Maybe Text) Source #
The current version of the cache policy.
createCachePolicyResponse_location :: Lens' CreateCachePolicyResponse (Maybe Text) Source #
The fully qualified URI of the cache policy just created.
createCachePolicyResponse_httpStatus :: Lens' CreateCachePolicyResponse Int Source #
The response's http status code.