-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
re-visit re-validating Web cache #2162
Comments
I reopened #2166. The web-ui errors and api errors co-exists and might have the same root cause. Please check. |
This issue is about web cache, not the API's failing. If you find an issue, please create a new one. I have removed the old comments to keep this feature clean. |
I did some checking on an ESP32-S3 and v3.7.1-dev, and it does look like the cache is working. When I deliberately change some of the web code and re-upload using the Download/Upload page, the browser refreshes the cache for the changed .js files (HTTP 200) and displays the correct version without the need for a ctrl-r/ctrl-f5, while the ones that haven't been changed stay at HTTP 304. This makes sense since the web code already uses Cache Busting during the webpack process. Each generated filename has a unique generated hash key in the name like
I'll leave this issue open for a while. I only tested on Edge. If anyone can reproduce the browser refresh not happening, I'll gladly dig deeper into this. For reference, this is a nice article: https://medium.com/@fatehalisulthoni/cache-busting-3-ways-to-fix-stale-deployment-in-react-8fc046fa7e92 |
I heard from BBQKees that some users are still seeing issues with the Web not refreshing after a firmware upgrade (browser cache is stale). If anyone encounters this issue please update this GitHub issue with
|
I think this is when updating from v3.6.5, 3.6.5 have cache setting expire after one year, so brower take it and does not look for new settings. |
Usually I get these questions when people are upgrading from 3.6.5. |
okay. I need to check in which version I added the Etags and cache timeouts. I thought it was in 3.6.5. The generated .js filenames should be different when going from 3.6.5->3.7.x so it's strange that they don't automatically refresh. We can certainly add some text to the "EMS-ESP is restarting, please wait..." but I'd rather find a more elegant way. Kees once suggested that when EMS-ESP starts, it'll show a Welcome Page (which you can click away) with upgrade notes. We can make a new Rest endpoint for this and load the text from the backend, but it'll mean adding all this static text into Flash for each version. |
The js differs, but the html page has same name. Browser loads the html page, checks the cache and loads the old page and scripts. |
With consistent newer versions of the WebUI some users still need to CTRL-R to browser refresh the cache. I was hoping we had fixed this by calculating a hash code for each html/js .gz file, including the date (which is the build time) and adding this to the HTTP headers, but it seems not to be fully working.
The code is in function
ESP8266React::WWData::registerRoutes()
with this code section:Need to look into this again.
The text was updated successfully, but these errors were encountered: