chore: disable GET response caching and Cache-Control header in proxy_request handler

This commit is contained in:
retoor 2025-12-08 03:53:13 +00:00
parent 8adaffe9f3
commit 6956a757f2

View File

@ -72,9 +72,9 @@ async def proxy_request(request, method, max_retries=10, retry_delay=2):
status=resp.status,
content_type=resp.content_type
)
if method == 'GET':
api_cache[api_url] = (data, resp.status, resp.content_type)
response.headers['Cache-Control'] = f'public, max-age={API_CACHE_MAX_AGE}'
#if method == 'GET':
#api_cache[api_url] = (data, resp.status, resp.content_type)
#response.headers['Cache-Control'] = f'public, max-age={API_CACHE_MAX_AGE}'
return add_cors_headers(response)
except Exception:
if attempt < max_retries - 1: