This commit is contained in:
Aevann1 2021-08-23 12:00:05 +02:00
parent 5751893620
commit b765455299
2 changed files with 5 additions and 1 deletions

View file

@ -135,6 +135,10 @@ def archives(path):
def static_service(path):
resp = make_response(send_from_directory('./assets', path))
if request.path.endswith('.css'): resp.headers.add("Content-Type", "text/css")
if request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff') or request.path.endswith('.woff2'):
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=31556952")
return resp
@app.get("/robots.txt")