Merge pull request #86 from unslothai/fix/index-html-cache-headers
Fix: Browser serving stale frontend after rebuild
This commit is contained in:
commit
7411be50a0
1 changed files with 2 additions and 2 deletions
|
|
@ -128,7 +128,7 @@ def setup_frontend(app: FastAPI, build_path: Path):
|
|||
|
||||
@app.get("/")
|
||||
async def serve_root():
|
||||
return FileResponse(build_path / "index.html")
|
||||
return FileResponse(build_path / "index.html", headers={"Cache-Control": "no-cache, no-store, must-revalidate"})
|
||||
|
||||
@app.get("/{full_path:path}")
|
||||
async def serve_frontend(full_path: str):
|
||||
|
|
@ -139,7 +139,7 @@ def setup_frontend(app: FastAPI, build_path: Path):
|
|||
if file_path.is_file():
|
||||
return FileResponse(file_path)
|
||||
|
||||
return FileResponse(build_path / "index.html")
|
||||
return FileResponse(build_path / "index.html", headers={"Cache-Control": "no-cache, no-store, must-revalidate"})
|
||||
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue