You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
favicons love to be cached which can cause them to not show up correctly a lot of time in the dev environment, it comes up fairly consistently in the discord
This can be worked around by appending the favicon with some info specifically related to the caching
Although this does not work while in dev mode, the hash is only applied when building. To get this working in dev, you can use a hack like this:
---importfaviconfrom'../favicon.svg'const faviconSrc =import.meta.env.DEV// Prevent caching in dev with a Unix time stamp?`${favicon.src}?${(newDate()).valueOf()}`// Prevent caching in production with the default cache busting hashes:favicon.src---
<linkrel="icon"type="image/svg+xml"href={faviconSrc} />
One issue with this hack is that the favicon will never be cached in dev mode, even if it hasn't changed, because the Unix time stamp will always return a unique path. But, this shouldn't be a problem because it only happens in dev mode.
favicons love to be cached which can cause them to not show up correctly a lot of time in the dev environment, it comes up fairly consistently in the discord
This can be worked around by appending the favicon with some info specifically related to the caching
The text was updated successfully, but these errors were encountered: