Skip to content
v2.278.0

ServerTimingHeadersConfigProperty ​

Struct External

A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const serverTimingHeadersConfigProperty: cloudfront.CfnResponseHeadersPolicy.ServerTimingHeadersConfigProperty = {
  enabled: false,

  // the properties below are optional
  samplingRate: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront

server_timing_headers_config_property = cloudfront.CfnResponseHeadersPolicy.ServerTimingHeadersConfigProperty(
    enabled=False,

    # the properties below are optional
    sampling_rate=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;

ServerTimingHeadersConfigProperty serverTimingHeadersConfigProperty = ServerTimingHeadersConfigProperty.builder()
        .enabled(false)

        // the properties below are optional
        .samplingRate(123)
        .build();
csharp
// 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.CloudFront;

var serverTimingHeadersConfigProperty = new ServerTimingHeadersConfigProperty {
    Enabled = false,

    // the properties below are optional
    SamplingRate = 123
};
go
// 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"

serverTimingHeadersConfigProperty := &ServerTimingHeadersConfigProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	SamplingRate: jsii.Number(123),
}

Properties ​

enabledboolean | IResolvableenabledtyping.Union[bool, IResolvable]enabledBooleanEnabledboolEnabledinterface{} required #
A Boolean that determines whether CloudFront adds the `Server-Timing` header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
samplingRateoptionalnumbersampling_rateoptionalint | floatsamplingRateoptionalNumberSamplingRateoptionaldoubleSamplingRateoptional*float64 #
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the `Server-Timing` header to.
notes

When you set the sampling rate to 100, CloudFront adds the Server-Timing header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.