diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index e8fdb700..a558dae3 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -908,7 +908,9 @@ def create_app(args): async def get_response(self, path: str, scope): response = await super().get_response(path, scope) - if path.endswith(".html"): + is_html = path.endswith(".html") or response.media_type == "text/html" + + if is_html: response.headers["Cache-Control"] = ( "no-cache, no-store, must-revalidate" )