Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/gold_tests/cache/replay/cache-control-max-age.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- request_for_zero_max_age: &request_for_zero_max_age
client-request:
method: "GET"
Expand All @@ -44,6 +48,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- request_for_negative_max_age: &request_for_negative_max_age
client-request:
method: "GET"
Expand All @@ -54,6 +62,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- request_for_non_number_max_age: &request_for_non_number_max_age
client-request:
method: "GET"
Expand All @@ -64,6 +76,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- 200_ok_response: &200_ok_response
server-response:
status: 200
Expand Down Expand Up @@ -249,6 +265,10 @@ sessions:
- [ Host, example.com ]
- [ Cache-Control, max-age=300 ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should be replied to out of the cache, therefore this 400 response
# should not make it to the client.
server-response:
Expand Down Expand Up @@ -296,6 +316,10 @@ sessions:
- [ Host, example.com ]
- [ Cache-Control, max-age=0 ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should go through to the server because the 0 max-age
# directive in the request should make ATS consider it stale.
server-response:
Expand Down Expand Up @@ -345,6 +369,10 @@ sessions:
- [ Host, example.com ]
- [ Cache-Control, max-age=-300 ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should go through to the server because the negative max-age
# directive in the request should make ATS consider it stale.
server-response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

sessions:
- transactions:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# Since 404 responses are customized to not be cached, this will go
# through.
<<: *200_response
Expand Down Expand Up @@ -115,6 +119,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# By customization, the 400 will be cached and this will not go through.
<<: *200_response

Expand Down Expand Up @@ -151,6 +159,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should not go to the server since the 200 response is cached.
server-response:
status: 400
Expand Down
16 changes: 16 additions & 0 deletions tests/gold_tests/cache/replay/negative-caching-default.replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# 404 responses should be cached when negative caching is enabled, so this
# should not get to the server. But if it does, return a 200 so the test
# knows that something went wrong.
Expand Down Expand Up @@ -113,6 +117,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# 400 responses should not be cached. Verify this goes to the server
# by returning and expecting a 200 response.
<<: *200_response
Expand Down Expand Up @@ -149,6 +157,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should not go to the server, but if it does return a 400 so we catch
# it.
server-response:
Expand Down Expand Up @@ -197,6 +209,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# 405 responses should not be cached. Verify this goes to the server
# by returning and expecting a 200 response.
<<: *200_response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- request_for_path_404: &request_for_path_404
client-request:
method: "GET"
Expand All @@ -42,6 +46,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

- request_for_no_cache_control_response: &request_for_no_cache_control_response
client-request:
method: "GET"
Expand All @@ -52,6 +60,11 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms


- request_for_404_with_cc: &request_for_404_with_cc
client-request:
method: "GET"
Expand All @@ -62,6 +75,10 @@ meta:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

sessions:
- transactions:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# This should not go to the server. Verify we get the cached 404 response
# instead of this new 403 response.
server-response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ sessions:
fields:
- [ Host, example.com ]

# Add a delay so ATS has time to finish any caching IO for the previous
# transaction.
delay: 50ms

# 403 responses should be cached when negative caching is enabled, so this
# should not get to the server. But if it does, return a 404 so the test
# knows that something went wrong.
Expand Down