3 ms·
May I ask the justification to download 1-10MB JSON on the user's system without the user being aware?
by pmlnr 8y ago
May I ask the justification to download 1-10MB JSON on the user's system without the user being aware?
- ahsanejaz 8y agoYou also cache regular web resources like images. It is for the user's benefit since next visit to the site can be faster.
- pmlnr 8y agoYou misunderstand. Service worker traffic is invisible, unlike loading an image and generally speaking can't be governed, unlike visible elements. Loading 1-10MB JSON might drain a significant portion of mobile data. It could take a long time, meaning it may need to re-start it a couple of times, due to, say, a flaky 3G connection. I'm curious on the why - unless this is an announced feature, I don't think this should be an automatic process and should only be done on user demand explicitly.
- sbr464 8y agoI agree with you, there are several settings avail to control what is optimized, it’s typically enabled on faster devices/connections at work. I would be upset as well if a site naively used up a connection in the background.
- sbr464 8y agoThey are aware, it’s business software, syncing records/templates/frequent info etc. It’s only to improve the experience, and it’s controlled by settings/opt-in etc. It’s also configurable to only operate on faster connections/non mobile IP address etc. The main reason I was asking is if you currently benchmark service worker updates with indexedDB for async/larger updates, they still cause a small amount of jank, (at least on larger requests) even though they may use a different process etc. There’s a github repo with a benchmark, this link is older but if you clone the current version and update to the lastest packages, the results are still similar. https://www.google.com/amp/s/nolanlawson.com/2015/09/29/indexeddb-websql-localstorage-what-blocks-the-dom/amp/