angular / angular

Deliver web apps with confidence πŸš€
https://angular.dev
MIT License
96.09k stars 25.43k forks source link

Service worker cache progress or finished event #30860

Closed MrCircuit closed 3 years ago

MrCircuit commented 5 years ago

πŸš€ feature request

Relevant Package

This feature request is for @angular/service-worker ### Description The angular service worker already provides an easy to use and robust caching solution for the assets of a web application. Nevertheless, there is currently no way to tell the user, at which percentage of the total amount of data the caching currently is working at and when it finished downloading the installation or update. Especially for use cases where the user just want to stay online for the time of installation or update, this issue is creating huge documentation and deployment problems for an offline web app. ### Describe the solution you'd like Although there is a similar, but much more general feature request (#22543), it would be great to just have a set of events, that report progress and / or start and finish of the caching process. ### Describe alternatives you've considered The current workaround is, that the users have to wait an indetermined amount of time until the web app is downloaded completely. The usage of the "network" tabs of the developer tools of browsers, where the progress can be monitored, is not wanted.
gkalpak commented 5 years ago

It is an interesting feature request. I can imagine it would be a little complicated to get right, because there several different situations and they change dynamically without a way to know beforehand.

For example:

MrCircuit commented 5 years ago

I agree, that a perfect progress indicator with an accurate percentage of bytes transferred may be difficult to implement without this knowledge. But as far as I understood, at least the process itself is known in the interiors of the SW (e.g. the asset file list, the start of caching and the end of caching)? This would already help to a great extend - the user can be notified when everything is all set.

gkalpak commented 5 years ago

This would already help to a great extend - the user can be notified when everything is all set.

That's the thing. It is not easy to know if/when "everything is all set" (or what "all set" means). I am not saying it is not doable, just that there are many edge cases that need to be taken into account.

And there is also the issue of when/how often to notify the client to avoid spamming them.

angular-robot[bot] commented 3 years ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] commented 3 years ago

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

gkalpak commented 3 years ago

While this is an interesting feature, there doesn't seem to be a high demand for it. Closing for now.

atamansv commented 3 years ago

A "finished" event would be very useful due to the large assets of our project and the slow internet of the target customers!

gkalpak commented 3 years ago

@atamansv, you might want to follow #39840 (not sure if it's going to be implemented or not, but it is being tracked there).

atamansv commented 3 years ago

Thanks for the tip. Unfortunately, because of this and due to there is no support for http multiplexing, I have to write my own service worker

angular-automatic-lock-bot[bot] commented 3 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.