-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve hacsfiles
caching
#1653
Comments
Make sure you have read the issue guidelines and that you filled out the entire template. |
Files are requested by browser clients. |
I've been digging around for a way to trigger a "frontend update" when lovelace resources are updated but I haven't found a good way to do it. My workaround was to switch out |
I have spent a lot of time on figuring out something in the past, but nothing was stable enough for me to implement without it causing issues for disconnected clients / mobile apps |
One of my installs loads slow on mobile and I did some investigating and narrowed part of the issue down to the frontend having to re-download 9 js files in
/hacsfiles/...
I'm trying to come up with a way to solve caching issue with the frontend files being loaded every time because of the
custom_components.hacs.webresponses.category.async_serve_category_file
explicitly disabling caching which I assume is to ensure updates can happen without clearing browser cache.In my install I have 9 included JS files like:
/hacsfiles/lovelace-card-tools/card-tools.js
I'm thinking one way to allow caching would be do so something like
/hacsfiles/id-<HASH>/lovelace-card-tools/card-tools.js
Then any url that matches
/hacsfiles/id-
could haveid-<HASH>
stripped.When the
card-tools.js
file changes, recalculate the hash of the file contents and change the url in the frontend if needed.The text was updated successfully, but these errors were encountered: