ci: pre-warm dictionary cache + give /api/dictionary 6h TTL

Adds a workflow step that fetches the four dictionary endpoints
(world_regions, countries, cities, airports — see api.ts) before
playwright runs. With the longer 6h TTL on /api/dictionary, every
e2e spec hits cache for the same 4 URLs that drive most of the
data-driven tests (breadcrumb city names, etc).

2s sleeps between warm-up calls keep the cold-cache pass under the
WAF rate-limit window.
This commit is contained in:
2026-04-27 17:26:27 +03:00
parent 767cc9a68b
commit 3c6fa81d33
2 changed files with 44 additions and 0 deletions
@@ -43,6 +43,27 @@ server {
#
# Cached to absorb e2e bursts that would otherwise trip the upstream
# WAF rate limit. Only GET/HEAD are cached (default proxy_cache_methods).
#
# Dictionary endpoints (cities, airports, countries, world_regions) are
# essentially static — pre-warmed by CI and held for 6h. Other /api/*
# paths are dynamic queries; 1m is a reasonable freshness budget.
location /api/dictionary/ {
auth_basic off;
proxy_pass https://127.0.0.1:8443;
proxy_set_header Host flights.test.aeroflot.ru;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ssl_server_name on;
proxy_ssl_name flights.test.aeroflot.ru;
proxy_cache flights_api;
proxy_cache_key "$scheme$host$request_uri";
proxy_cache_valid 200 6h;
proxy_cache_valid 404 5m;
proxy_cache_lock on;
proxy_cache_use_stale error timeout updating http_403 http_500 http_502 http_503 http_504;
add_header X-Cache-Status $upstream_cache_status always;
}
location /api/ {
auth_basic off;
proxy_pass https://127.0.0.1:8443;