it seems like the language and theme switcher are broken until the website's cache is cleared on the user end, which is a bit annoying. I wish there was a way for a website to force a complete reload or something
alternatively, a little JS in a script tag to append the date/time to the stylesheet href as a url param means you never need to update the version manually to ensure users always get the newest stylesheet.
You should be able to add the following code either in a script tag on the page, or in a global script.js file or something if you have one of those, which it looks like you do.
document.querySelectorAll("link[rel='stylesheet']").forEach(link => link.href = link.href.split('?')[0] + '?v=' + Date.now());
Apologies for the all the page updates, I added little theme switcher!
it seems like the language and theme switcher are broken until the website's cache is cleared on the user end, which is a bit annoying. I wish there was a way for a website to force a complete reload or something
There kinda is! You can put a "?v=2" (or whatever version number) after the link to the stylesheet so the browser has to reload it again
Thank you! I have included it on my site, let's see if it works!
alternatively, a little JS in a script tag to append the date/time to the stylesheet href as a url param means you never need to update the version manually to ensure users always get the newest stylesheet.
Ooo that's a cool way of doing it! Does your website use that? May I steal it for mine own :p
You should be able to add the following code either in a script tag on the page, or in a global script.js file or something if you have one of those, which it looks like you do. document.querySelectorAll("link[rel='stylesheet']").forEach(link => link.href = link.href.split('?')[0] + '?v=' + Date.now());
Tysm!!