HA Caching

So I’m getting increasingly annoyed by the HA caching.

I use HACS and always click the reload option for card updates but it never seems to ‘do’ anything.

When I go back to the lovelace view the old card is still used and I am now in the habit of using the dev-tools+empty cache and hard reload+ 2 or 3 CTRL+F5 before the new card is ‘live’. Is there anything I can do to stop having to do this all the time?

I also have users using my custom weather card who are having problems caused by this as well so it’s not just me…

3 Likes

I have noticed this as well; ctrl-f5 used to work just fine but rarely anymore. I find myself having to actually go into settings and clearing cache (which ctrl-f5 ‘should’ do). I don’t know if it is a HA problem or a FireFox problem.

Discussed this with Ludeeus and Thomas Loven on Discord:

It requests a webpage reload without cache location.reload(true);, if you use https however the serviceworker has it’s own caching rules

We discussed adding a version like before HACS…

Aaaand… it should really not be needed, since the files are served with instructions to not cache them at all…
But for the past half year or so, chrome atleast ignores that part for pages that uses a serviceworker

So I suspect Ludeeus might make HACS add a version to break the cache soon…

2 Likes

Have you tried chrome dev tools > network > disable cache ?

1 Like

No but you generally want caching on - you just want it to be able to load fresh a changed resource.
Empty Cache and Hard reload with a few ctrl+r refreshes work but it’s a pita

Yeah I agree, but it does help with HA when going through updates / editing the dashboard. You might want to look for some chrome extensions that can do this on a per host level. Or just disable cache when updating, and turn it back on when you’re done.

It’s easiest just managing it as I already am but I look forward to Ludeeus tweaking it in Hacs