HttpRequestCacheConfigurationProperty Struct
The optional response-caching configuration shared by the HTTP-based function types (HTTP_REQUEST, AWS_SERVICE_REQUEST, and VAST_REQUEST).
When you provide this configuration, MediaTailor caches function responses with HTTP status codes 200, 203, 204, 404, 405, 410, 414, or 501. For a cacheable response, MediaTailor uses the Cache-Control max-age directive limited to the range between TtlMinimumSeconds and TtlMaximumSeconds. If no max-age directive is present, MediaTailor uses TtlMinimumSeconds. Cached HTTP responses are scoped per playback configuration, not per function.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_mediatailor as mediatailor } from 'aws-cdk-lib';
const httpRequestCacheConfigurationProperty: mediatailor.CfnFunction.HttpRequestCacheConfigurationProperty = {
ttlMaximumSeconds: 123,
ttlMinimumSeconds: 123,
// the properties below are optional
key: 'key',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_mediatailor as mediatailor
http_request_cache_configuration_property = mediatailor.CfnFunction.HttpRequestCacheConfigurationProperty(
ttl_maximum_seconds=123,
ttl_minimum_seconds=123,
# the properties below are optional
key="key"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.mediatailor.*;
HttpRequestCacheConfigurationProperty httpRequestCacheConfigurationProperty = HttpRequestCacheConfigurationProperty.builder()
.ttlMaximumSeconds(123)
.ttlMinimumSeconds(123)
// the properties below are optional
.key("key")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.MediaTailor;
var httpRequestCacheConfigurationProperty = new HttpRequestCacheConfigurationProperty {
TtlMaximumSeconds = 123,
TtlMinimumSeconds = 123,
// the properties below are optional
Key = "key"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
httpRequestCacheConfigurationProperty := &HttpRequestCacheConfigurationProperty{
TtlMaximumSeconds: jsii.Number(123),
TtlMinimumSeconds: jsii.Number(123),
// the properties below are optional
Key: jsii.String("key"),
}
Properties
By default, the cache key is a hash of the HTTP URL, request body, and HTTP method; request headers are not included. The evaluated key must be smaller than 1 KB.
ttlMaximumSecondsnumberttl_maximum_secondsint | floatttlMaximumSecondsNumberTtlMaximumSecondsdoubleTtlMaximumSeconds*float64 required #This value must be greater than or equal to TtlMinimumSeconds.
ttlMinimumSecondsnumberttl_minimum_secondsint | floatttlMinimumSecondsNumberTtlMinimumSecondsdoubleTtlMinimumSeconds*float64 required #MediaTailor also uses this value as the cache duration when a response has no Cache-Control max-age directive.