INNER CODE UNIT · Python
add_no_cache_headers
google/mcp-security · run-with-google-adk/src/mcp_security_agent/server/app.py:43
async def add_no_cache_headers(request, call_next):
response = await call_next(request)
path = request.url.path
if path.startswith("/static") or path in ["/", "/login", "/landing.html", "/index.html", "/chat.html"]:
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
return response
return app