Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 354631b

Browse filesBrowse files
authored
feat(infra): do not cache static 404s (#2622)
* feat(infra): do not cache static 404s * feat(infra): apply condition
1 parent 4c44d80 commit 354631b
Copy full SHA for 354631b

File tree

1 file changed

+15
-0
lines changed
Filter options

1 file changed

+15
-0
lines changed

‎infra/cdn/main.tf

Copy file name to clipboardExpand all lines: infra/cdn/main.tf
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ resource "fastly_service_vcl" "python_org" {
6868
ttl = 0
6969
}
7070

71+
cache_setting {
72+
action = "pass"
73+
cache_condition = "Don't cache 404s for /static"
74+
name = "No caching for /static 404s"
75+
stale_ttl = 0
76+
ttl = 0
77+
}
78+
7179
condition {
7280
name = "Force Pass No-Cache No-Store"
7381
priority = 10
@@ -129,6 +137,13 @@ resource "fastly_service_vcl" "python_org" {
129137
type = "REQUEST"
130138
}
131139

140+
condition {
141+
name = "Don't cache 404s for /static"
142+
priority = 10
143+
statement = "req.url ~ \"^/static/\" && beresp.status == 404"
144+
type = "CACHE"
145+
}
146+
132147
gzip {
133148
name = "Default rules"
134149
content_types = [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.