Skip to content
Doug Nelson edited this page Dec 2, 2023 · 1 revision

Sticky cache is a blessing and a curse

Home Assistant has a very sticky cache. Sometimes, it's so sticky that conventional cache clearing methods don't work the first or second time you try them. I've even seen cases where cache from several weeks ago somehow manages to show up and then disappear, which shouldn't even be possible.

I'm not entirely sure how the Home Assistant devs were able to make the cache so sticky, but I can guarantee you they made it that way so that we can all experience the tremendous speed boosts and responsiveness that a good caching system provides. It's not a bug, it's a feature.

So, how do we clear that sticky persistent cache?

Try this First (easy)

  1. If you are interacting with Home Assistant through a web browser, try clicking on the browser's refresh button.
  2. If the refresh button didn't work, try clearing the browser's cache and then click the refresh button once more

Try this Next (takes a minute or two)

Restart your Home Assistant instance

  1. Click on Settings
  2. Click on System image
  3. Click the Power Icon in the upper right hand corner
  4. In the menu that pops up, click on Restart Home Assistant image
  5. A confirmation box will appear. Click on RESTART

image

At this point, Home Assistant will take a moment to restart. Depending on your system setup, this could take a minute or two. After it comes back, check to see if your issue has been resolved.

This WILL clear the cache if all else fails

Depending on how you interact with Home Assistant, you will want to choose the option below that best fits your use case.

Chrome / Chromium

First, I open the chromium developer tools. This can be done one of three ways:

  • Right-click anywhere in your browser window, then scrolldown to "Inspect"
  • Click the three dots in the upper right hand corner, choose "More Tools" and then "Developer Tools"
  • Hold down Ctrl + Shift and press I (i for inspect)

image
image

With the developer tools open, open the Network tab and check the box marked "Disable cache"

image

At this point, If you press F5 or click your browser's refresh button, you will see the the developer tools screen fill with information related to your page re-load. If you do not see a console window at the bottom of the developer tools, pressing the ESC key will likely toggle it back into view.

image

In the console window, you might find some information that could be helpful for you in the future. For instance, if you ask yourself "Do I actually have Firemote version 2.1.6 installed right now?" you could find that answer in the console window:

image

These next steps I do to ensure a full proper refresh are quite heavy handed, and it's possible that not all of these steps are required. I have found that in my setup, this seems to work almost all of the time so it's what I do.

Click on the clear buttons in both the network tab and the console.

image
image
image


Next, I hold down CTRL + ALT + SHIFT and then click the browser's reload button
image

This seems to be the magic process that works. It may not be appropriate in every situation, but it works for me.


iOS Home Assistant App

First, click on "Settings" in your Home Assistant App

Then, select Companion App
image

Next, select Debugging:
image

Then finally, click on Reset Frontend Cache
image

This seems to work most of the time. If it doesn't work right away, I suggest closing the Home Assistant app and re-opening it. If it's still not updated, try the above steps again.

Android Home Assistant App

This one is the trickiest for me, I usually have to repeat these steps 2 or 3 times before I get anywhere. Hopefully I will someday find a better way, but as of today this is what I do.

Swipe the screen from top to bottom to access the pulldown menu. Click the gear icon to access the settings menu
image

Next, locate and click on the Apps menu
image

Then, scroll through your apps until you find the Home Assistant app, then click on it
image

The App Info menu should be open, showing the details for the currently installed Home Assistant App. Find "Storage" and click on it
image

You should now see the size of the current app cache, and a button to clear the app's cache. Click on the "Clear cache" button
image

Here is where it gets a little interesting (or frustrating) The screen shows that the cache has been cleared
image

BUT... if you click back one menu, and step back into this one, you might find this
image

The cache has quickly grown back from zero. It's nowhere near the size it was when we first got here, but it's not empty either. I'm uncertain if this behavior is the reason why it sometimes takes multiple tries, a Force Stop, or a device reboot to ultimately show me the updated content, but either way it can be very frustrating.

Clone this wiki locally