Mercurial > hg > nginx-tests
comparison proxy_cache_use_stale.t @ 1999:15f538440a77 default tip
Tests: adjusted proxy_cache_use_stale.t cache validity.
At least the "s-w-r - updating stale" test sometimes fails on slow
hosts due to "stale-while-revalidate=4" being not enough, so the request
returns with the EXPIRED cache status instead of STALE.
Fix is to use larger "stale-while-revalidate=" times where it is not
significant.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 09 Aug 2024 18:37:25 +0300 |
parents | a095b971fbcc |
children |
comparison
equal
deleted
inserted
replaced
1998:6b3b31149551 | 1999:15f538440a77 |
---|---|
161 'stale-while-revalidate'); | 161 'stale-while-revalidate'); |
162 like(http_get('/t2.html'), qr/HIT/, 's-w-r - cached'); | 162 like(http_get('/t2.html'), qr/HIT/, 's-w-r - cached'); |
163 | 163 |
164 get('/tt.html', 'max-age=1, stale-if-error=3'); | 164 get('/tt.html', 'max-age=1, stale-if-error=3'); |
165 get('/t3.html', 'max-age=1, stale-while-revalidate=2'); | 165 get('/t3.html', 'max-age=1, stale-while-revalidate=2'); |
166 get('/t4.html', 'max-age=1, stale-while-revalidate=3'); | 166 get('/t4.html', 'max-age=1, stale-while-revalidate=10'); |
167 get('/t5.html', 'max-age=1, stale-while-revalidate=3'); | 167 get('/t5.html', 'max-age=1, stale-while-revalidate=10'); |
168 get('/t6.html', 'max-age=1, stale-while-revalidate=4'); | 168 get('/t6.html', 'max-age=1, stale-while-revalidate=10'); |
169 get('/t7.html', 'max-age=1, stale-while-revalidate=10'); | 169 get('/t7.html', 'max-age=1, stale-while-revalidate=10'); |
170 http_get('/ssi.html'); | 170 http_get('/ssi.html'); |
171 get('/updating/t.html', 'max-age=1'); | 171 get('/updating/t.html', 'max-age=1'); |
172 get('/updating/t2.html', 'max-age=1, stale-while-revalidate=2'); | 172 get('/updating/t2.html', 'max-age=1, stale-while-revalidate=2'); |
173 get('/updating/tt.html', 'max-age=1, stale-if-error=5'); | 173 get('/updating/tt.html', 'max-age=1, stale-if-error=5'); |