v0.34.0_2
This commit is contained in:
1 parent
0a8bc6f040
commit
434e789144
38 files changed
+899
-238
No files matched your search
@@ -65,7 +65,7 @@ def request(port, path, encoding='identity'):
|
||||
'x_cache_hits': headers.get('x-cache-hits'), 'x_cache_resident_age': headers.get('x-cache-resident-age'),
|
||||
'cache_status': headers.get('cache-status'), 'age': headers.get('age'),
|
||||
'body': body.decode('utf-8', 'replace'), 'content_length': headers.get('content-length'),
|
||||
'etag': headers.get('etag'), 'encoding': headers.get('content-encoding'), 'origin_count': COUNTS[path]}
|
||||
'etag': headers.get('etag'), 'encoding': headers.get('content-encoding'), 'origin_count': COUNTS[path.split('?', 1)[0]]}
|
||||
|
||||
|
||||
def dash(rust):
|
||||
@@ -133,6 +133,25 @@ def run(binary: Path, output: Path, expect_old_age_bug: bool):
|
||||
aged_br = find(snapshot, '/aged-br.css')
|
||||
assert aged_br['transformed'] and aged_br['remaining_ttl_seconds'] >= 86_000, aged_br
|
||||
|
||||
# Query-string bypass is an explicit administrator rule. Even a
|
||||
# transformed CSS with public max-age stays BYPASS while it is ON,
|
||||
# then the *same* URL must become MISS -> HIT after disabling it.
|
||||
# This is not a transform regression: it is a request policy.
|
||||
cfg['cache']['bypass_query'] = True
|
||||
rust.apply(cfg, 'query-bypass-enabled')
|
||||
query_path = '/normal.css?v=transformed-public'
|
||||
before = COUNTS['/normal.css']
|
||||
q_bypass = [request(rust.reverse_port, query_path) for _ in range(2)]
|
||||
assert [row['x_cache'] for row in q_bypass] == ['BYPASS', 'BYPASS'], q_bypass
|
||||
assert COUNTS['/normal.css'] - before == 2, q_bypass
|
||||
cfg['cache']['bypass_query'] = False
|
||||
rust.apply(cfg, 'query-bypass-disabled')
|
||||
q_cached = [request(rust.reverse_port, query_path) for _ in range(2)]
|
||||
assert [row['x_cache'] for row in q_cached] == ['MISS', 'HIT'], q_cached
|
||||
assert q_cached[1]['cache_status'] and 'transformed' in q_cached[1]['cache_status']
|
||||
assert COUNTS['/normal.css'] - before == 3, q_cached
|
||||
outcome['tests'].append({'query_bypass_policy': {'bypass': q_bypass, 'cached': q_cached}})
|
||||
|
||||
# Operational LB tuning must not invalidate a cached representation.
|
||||
before = COUNTS['/normal.css']
|
||||
cfg['vhosts'][0]['load_balancing']['keepalive'] = {'max_idle_per_host': 16}
|
||||
|
||||
Reference in new issue
Block a user