mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Enable compression on frontend index page (#108148)
This commit is contained in:
parent
09234ca3af
commit
549ff6ddc6
@ -610,7 +610,8 @@ class IndexView(web_urldispatcher.AbstractResource):
|
|||||||
else:
|
else:
|
||||||
extra_modules = hass.data[DATA_EXTRA_MODULE_URL].urls
|
extra_modules = hass.data[DATA_EXTRA_MODULE_URL].urls
|
||||||
extra_js_es5 = hass.data[DATA_EXTRA_JS_URL_ES5].urls
|
extra_js_es5 = hass.data[DATA_EXTRA_JS_URL_ES5].urls
|
||||||
return web.Response(
|
|
||||||
|
response = web.Response(
|
||||||
text=_async_render_index_cached(
|
text=_async_render_index_cached(
|
||||||
template,
|
template,
|
||||||
theme_color=MANIFEST_JSON["theme_color"],
|
theme_color=MANIFEST_JSON["theme_color"],
|
||||||
@ -619,6 +620,8 @@ class IndexView(web_urldispatcher.AbstractResource):
|
|||||||
),
|
),
|
||||||
content_type="text/html",
|
content_type="text/html",
|
||||||
)
|
)
|
||||||
|
response.enable_compression()
|
||||||
|
return response
|
||||||
|
|
||||||
def __len__(self) -> int:
|
def __len__(self) -> int:
|
||||||
"""Return length of resource."""
|
"""Return length of resource."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user