1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Let favicon be cached (#3729)

This commit is contained in:
Sebastian Lövdahl 2022-08-18 22:54:10 +03:00 committed by GitHub
parent fc15ddfa91
commit a47e92f2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -947,9 +947,12 @@ def make_app(debug=get_bool_env(ENV_DEV)):
class StaticFileHandler(tornado.web.StaticFileHandler): class StaticFileHandler(tornado.web.StaticFileHandler):
def set_extra_headers(self, path): def set_extra_headers(self, path):
self.set_header( if "favicon.ico" in path:
"Cache-Control", "no-store, no-cache, must-revalidate, max-age=0" self.set_header("Cache-Control", "max-age=84600, public")
) else:
self.set_header(
"Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"
)
app_settings = { app_settings = {
"debug": debug, "debug": debug,