fdfd
This commit is contained in:
parent
ae2fdbd194
commit
bd6148db95
21 changed files with 5 additions and 2 deletions
|
@ -134,8 +134,11 @@ def archives(path):
|
|||
@limiter.exempt
|
||||
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'):
|
||||
if request.path.endswith('.css'):
|
||||
resp.headers.add("Content-Type", "text/css")
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=86400")
|
||||
elif request.path.endswith('.gif') or request.path.endswith('.png') 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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue