From 43b36ac3c7ac6843ddd34605fa31a047590bb0c2 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:38:38 +1300 Subject: [PATCH] Allow static assets to be cached if not in debug mode (#5684) --- esphome/dashboard/dashboard.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index f6eb079430..b416b00e60 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -1328,9 +1328,11 @@ def make_app(debug=get_bool_env(ENV_DEV)): if "favicon.ico" in path: self.set_header("Cache-Control", "max-age=84600, public") else: - self.set_header( - "Cache-Control", "no-store, no-cache, must-revalidate, max-age=0" - ) + if debug: + self.set_header( + "Cache-Control", + "no-store, no-cache, must-revalidate, max-age=0", + ) app_settings = { "debug": debug,