Skip to content
Snippets Groups Projects
Commit 63768638 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

caching betinget av api-nøkkel

parent 90caa553
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,19 @@ Resources:
Type: "ALLOW"
Priority: 5
RuleId: !Ref APIRule
APICachePolicy:
Type: "AWS::CloudFront::CachePolicy"
Properties:
CachePolicyConfig:
DefaultTTL: 10800
MaxTTL: 28800
MinTTL: 60
Name: "APICachePolicy"
ParametersInCacheKeyAndForwardedToOrigin:
HeadersConfig:
HeaderBehavior: whitelist
Headers:
- "x-api-key"
Distribution:
Type: "AWS::CloudFront::Distribution"
Properties:
......@@ -185,9 +197,7 @@ Resources:
- OPTIONS
- PUT
- PATCH
MaxTTL: 28800
DefaultTTL: 10800
MinTTL: 60
CachePolicyId: !Ref APICachePolicy
TargetOriginId: OrdbokCache
LambdaFunctionAssociations:
- EventType: viewer-request
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment