From 511650a90260e0922bfeb1091b4babc597d36af6 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Sat, 20 Apr 2024 16:36:00 -0700 Subject: [PATCH] Allow the favicon to be cached The favicon is currently loaded directly by url. This commit changes it to be loaded by file-loader. Note, the default vue webpack file loader doesn't support ico file types (because it seems to expect to use a png here), so add that to the file loader config. This allows bmcweb [1] to provide caching headers for the favicon, and avoid downloading a new favicon on every refresh. Tested: Webui-vue loads, favicon in the network panel loads properly. [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/70644 Change-Id: I27e5b459ff8822294ac9273220111e9944e8d1e5 Signed-off-by: Ed Tanous --- public/index.html | 2 +- vue.config.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index c355ece422..e96efdaf2a 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - + OpenBMC Web UI diff --git a/vue.config.js b/vue.config.js index bd22674640..e66d5d15c5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -61,6 +61,14 @@ module.exports = { .rule('vue') .use('vue-svg-inline-loader') .loader('vue-svg-inline-loader'); + config.module + .rule('ico') + .test(/\.ico$/) + .use('file-loader') + .loader('file-loader') + .options({ + name: '[name].[contenthash:8].[ext]', + }); }, configureWebpack: (config) => { config.plugins.push(