-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcf-cache.tf
More file actions
84 lines (74 loc) · 1.98 KB
/
Copy pathcf-cache.tf
File metadata and controls
84 lines (74 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
resource "cloudflare_zone_setting" "cache_level" {
zone_id = local.zone_id
setting_id = "cache_level"
value = "aggressive"
}
resource "cloudflare_zone_setting" "browser_cache_ttl" {
zone_id = local.zone_id
setting_id = "browser_cache_ttl"
value = 14400
}
resource "cloudflare_zone_setting" "browser_check" {
zone_id = local.zone_id
setting_id = "browser_check"
value = "off"
}
resource "cloudflare_zone_setting" "challenge_ttl" {
zone_id = local.zone_id
setting_id = "challenge_ttl"
value = 1800
}
resource "cloudflare_zone_setting" "minify" {
zone_id = local.zone_id
setting_id = "minify"
value = {
css = "off"
html = "off"
js = "off"
}
}
resource "cloudflare_zone_setting" "brotli" {
zone_id = local.zone_id
setting_id = "brotli"
value = "on"
}
resource "cloudflare_zone_setting" "early_hints" {
zone_id = local.zone_id
setting_id = "early_hints"
value = "on"
}
resource "cloudflare_zone_setting" "rocket_loader" {
zone_id = local.zone_id
setting_id = "rocket_loader"
value = "off"
}
resource "cloudflare_zone_setting" "polish" {
zone_id = local.zone_id
setting_id = "polish"
value = "off"
}
resource "cloudflare_ruleset" "cache_rules" {
zone_id = local.zone_id
name = "Cache Rules"
description = "Cache static HTML content"
kind = "zone"
phase = "http_request_cache_settings"
rules = [
{
action = "set_cache_settings"
action_parameters = {
cache = true
edge_ttl = {
mode = "override_origin"
default = 3600
}
browser_ttl = {
mode = "respect_origin"
}
}
expression = "((http.host eq \"makeitwork.cloud\") or (http.host eq \"www.makeitwork.cloud\")) and ((http.request.uri.path eq \"/\") or (ends_with(http.request.uri.path, \".html\")))"
description = "Cache root and HTML pages for 1 hour at edge"
enabled = true
}
]
}