Fix linting
This commit is contained in:
parent
45cebc71c5
commit
85bed30764
1 changed files with 16 additions and 8 deletions
|
|
@ -484,11 +484,17 @@ def create_app(args):
|
|||
response = await super().get_response(path, scope)
|
||||
|
||||
if path.endswith(".html"):
|
||||
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
||||
response.headers["Cache-Control"] = (
|
||||
"no-cache, no-store, must-revalidate"
|
||||
)
|
||||
response.headers["Pragma"] = "no-cache"
|
||||
response.headers["Expires"] = "0"
|
||||
elif "/assets/" in path: # Assets (JS, CSS, images, fonts) generated by Vite with hash in filename
|
||||
response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
|
||||
elif (
|
||||
"/assets/" in path
|
||||
): # Assets (JS, CSS, images, fonts) generated by Vite with hash in filename
|
||||
response.headers["Cache-Control"] = (
|
||||
"public, max-age=31536000, immutable"
|
||||
)
|
||||
# Add other rules here if needed for non-HTML, non-asset files
|
||||
|
||||
# Ensure correct Content-Type
|
||||
|
|
@ -504,7 +510,9 @@ def create_app(args):
|
|||
static_dir.mkdir(exist_ok=True)
|
||||
app.mount(
|
||||
"/webui",
|
||||
SmartStaticFiles(directory=static_dir, html=True, check_dir=True), # Use SmartStaticFiles
|
||||
SmartStaticFiles(
|
||||
directory=static_dir, html=True, check_dir=True
|
||||
), # Use SmartStaticFiles
|
||||
name="webui",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue