From 4688171ce0c72add8ef6a0632fe16f4f55a72fcb Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 31 Aug 2020 09:25:39 +0200 Subject: [PATCH] Add cache headers to picture integration (#39402) --- homeassistant/components/image/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/image/__init__.py b/homeassistant/components/image/__init__.py index d08be3e9127..c68df580643 100644 --- a/homeassistant/components/image/__init__.py +++ b/homeassistant/components/image/__init__.py @@ -11,6 +11,7 @@ from aiohttp import hdrs, web from aiohttp.web_request import FileField import voluptuous as vol +from homeassistant.components.http.static import CACHE_HEADERS from homeassistant.components.http.view import HomeAssistantView from homeassistant.const import CONF_ID from homeassistant.core import HomeAssistant, callback @@ -197,7 +198,8 @@ class ImageServeView(HomeAssistantView): ) return web.FileResponse( - target_file, headers={hdrs.CONTENT_TYPE: image_info["content_type"]} + target_file, + headers={**CACHE_HEADERS, hdrs.CONTENT_TYPE: image_info["content_type"]}, )