PWA cache enhance #195
Mister-Hope
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Also noticed that the PWA updated slowly. It would be nice if omitting other html files could work fine. Curious about what will happen if users visit a non-cached html file (e.g. '/guide/') offline? Will it fallback to the homepage? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think we should not cache html by default. (Only cache home page and 404)
Several reasons:
Don't have any effect when installed.
Homepage is the PWA entrance.
Homepage, 404 with all js can work offline.
Slow upgrading
In previous versions of chrome, all requests are triggered. So pwa updates only takes seconds.
Butas this may block other request, so staring from a Chrome version ( likely between 78 - 80), service worker request is triggered one by one.
This means users may wait more than 1 minute to see the new content ( for v2 docs on netlify, 2 and a half minite for me with out VPN and 70s under VPN)
And if they are just quick searching, they may not notice they are reading a historical version.
(And it can be worse if they just close the browser before the PWA finish upgrading. If a new version lands before they open next time, they will never get an update )
If not cache html, they can see the actual version through direct visiting and if the service work is the newest, after loading the html, everythign will then come from service worker, and no more loadtime.
Also a refresh should be okey for users to see new contents even if they entered through homepage.
@meteorlxy WDYK?
This is the default behaviour for my v1 pwa plugin, and it works fine.
Beta Was this translation helpful? Give feedback.
All reactions