fix: no-cache headers on JS/CSS + version query params to bust browser cache
This commit is contained in:
Binary file not shown.
6
main.py
6
main.py
@@ -840,5 +840,9 @@ async def serve_static(path: str):
|
|||||||
"""Serve static files or return index.html for SPA routes."""
|
"""Serve static files or return index.html for SPA routes."""
|
||||||
file_path = static_dir / path
|
file_path = static_dir / path
|
||||||
if file_path.exists() and file_path.is_file():
|
if file_path.exists() and file_path.is_file():
|
||||||
return FileResponse(str(file_path))
|
response = FileResponse(str(file_path))
|
||||||
|
# Prevent caching of JS/CSS so code changes take effect without hard refresh
|
||||||
|
if path.endswith(('.js', '.css')):
|
||||||
|
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
||||||
|
return response
|
||||||
return FileResponse(str(static_dir / "index.html"))
|
return FileResponse(str(static_dir / "index.html"))
|
||||||
Binary file not shown.
@@ -6,6 +6,6 @@
|
|||||||
"originalName": "master_cv_template.docx",
|
"originalName": "master_cv_template.docx",
|
||||||
"path": "/root/workspace/cv-app/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx",
|
"path": "/root/workspace/cv-app/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx",
|
||||||
"uploadedAt": "2026-07-16T09:03:29.601Z",
|
"uploadedAt": "2026-07-16T09:03:29.601Z",
|
||||||
"updatedAt": "2026-07-16T11:12:12.609Z"
|
"updatedAt": "2026-07-16T11:15:01.909Z"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<!-- Modals -->
|
<!-- Modals -->
|
||||||
<div class="modal-overlay" id="modal-overlay"></div>
|
<div class="modal-overlay" id="modal-overlay"></div>
|
||||||
|
|
||||||
<script src="/static/app.js"></script>
|
<script src="/static/app.js?v=2"></script>
|
||||||
<script src="/static/carbone.js"></script>
|
<script src="/static/carbone.js?v=2"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user