You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Related to #1673
Describe the solution you'd like
As of today, all routes get the same HTML file even if the request originated as /, /search.html or /venia-tops.html or /valeria-two-layer-tank.html but with a different name. The problem arises when the user directly goes to a certain products page during the offline mode, whose HTML is not cached. Even though it is the same HTML since the route is different the browser will redirect to Network Unreachable error. This is because we give different names to routes that bear the same content and the service worker caches that HTML with the key as the route. We should change the HTML handler in service worker to save only 1 version of HTML and return it even if the request originated from a different route.
By not requesting HTML every time and utilizing a cached version till something changes we can save 855 Bytes of data over the network and also reduce our cache memory footprint.
Please let us know what packages this feature is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
The text was updated successfully, but these errors were encountered:
If the HTML changes in the future we can show a message like this
so the user can click and update the app.
This solution, I feel, might be annoying since customers who are shopping would not like to reload a page.
The second solution would be to use versioning API and request the current version of index.html and if:
that is same as what is in the cache return the cached HTML file
that is not same as what is in the cache, request new HTML file and update the cache
This was we won't be requesting 850 Bytes of data every time and also speed up the app load since it is served from cache, and if something changes we will only be wasting minimal amount of time.
Is your feature request related to a problem? Please describe.
Related to #1673
Describe the solution you'd like
As of today, all routes get the same HTML file even if the request originated as
/
,/search.html
or/venia-tops.html
or/valeria-two-layer-tank.html
but with a different name. The problem arises when the user directly goes to a certain products page during the offline mode, whose HTML is not cached. Even though it is the same HTML since the route is different the browser will redirect to Network Unreachable error. This is because we give different names to routes that bear the same content and the service worker caches that HTML with the key as the route. We should change the HTML handler in service worker to save only 1 version of HTML and return it even if the request originated from a different route.By not requesting HTML every time and utilizing a cached version till something changes we can save 855 Bytes of data over the network and also reduce our cache memory footprint.
Please let us know what packages this feature is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
The text was updated successfully, but these errors were encountered: