Title: Allow specifying a max age for the index page served by the Service Worker · Issue #39266 · angular/angular · GitHub
Open Graph Title: Allow specifying a max age for the index page served by the Service Worker · Issue #39266 · angular/angular
X Title: Allow specifying a max age for the index page served by the Service Worker · Issue #39266 · angular/angular
Description: Currently the Service Worker will serve the specified index file on navigation requests, checking for updates once the application has started. While this does provide offline support & improves the TTI, one issue is that there's no expi...
Open Graph Description: Currently the Service Worker will serve the specified index file on navigation requests, checking for updates once the application has started. While this does provide offline support & improves th...
X Description: Currently the Service Worker will serve the specified index file on navigation requests, checking for updates once the application has started. While this does provide offline support & improve...
Opengraph URL: https://github.com/angular/angular/issues/39266
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow specifying a max age for the index page served by the Service Worker","articleBody":"Currently the Service Worker will serve the specified index file on navigation requests, checking for updates once the application has started.\r\n\r\nWhile this does provide offline support & improves the TTI, one issue is that there's no expiration date for said index file: a returning user who had visited the site two months back will effectively run a 2-months old version of the app. This is posing an issue for us as, in addition to requiring our API to remain backwards compatible for a long period, said user will not see new features / bug fixes until the next visit, possibly a few weeks after, causing slow upgrade cycles (as confirmed through our analytics)\r\n\r\nThere is currently not a straightforward way to handle that staleness issue:\r\n- While the app does indeed know that a new version is available, showing an upgrade toast 30 seconds after loading a site one hasn't been to in a month is just weird (e.g. https://github.com/angular/angular/issues/22080#issuecomment-408987881 mention that this was removed from angular.io). Similarly force-refreshing the user isn't great either, especially as he/she can be in the middle of filling a form, since it takes a certain time for the SW to fetch the new app version.\r\n- Preventing the Service Worker from serving navigation requests solves the freshness issue but breaks offline & degrades the TTI.\r\n- Defining a `dataGroup` for the index file with a `maxAge` means the app shell hash isn't checked anymore, which means the app version integrity isn't guaranteed.\r\n\r\nAn intermediate solution could be to have a customizable maximum age for the app shell (index): if that max age (say a week) has been reached, the service worker would go to the network to re-fetch the shell. This effectively means that if a newer version of the app is available, all the new assets would have to be fetched for the app to load, losing the benefits of the SW background fetching. It would also break offline support for those users as well. However, frequently returning users would not experience that, and this would enforce a maximum staleness for the app.\r\n\r\nThere might be better ways to address the problem though, but the current situation of unlimited app cache duration isn't ideal.","author":{"url":"https://github.com/laurentgoudet","@type":"Person","name":"laurentgoudet"},"datePublished":"2020-10-14T14:57:24Z","url":"https://github.com/angular/angular/issues/39266"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e89c457d-e48c-a799-877e-442030527234 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8438:EA06E:11F8DC6:17096B1:6B010805 |
| html-safe-nonce | 936ed415c6a3785bc4689649f51f5095caa721abb72ea6d69cf33a0f3323a618 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDM4OkVBMDZFOjExRjhEQzY6MTcwOTZCMTo2QjAxMDgwNSIsInZpc2l0b3JfaWQiOiI0Mzg2NTAyOTE2NDEyODY4NjEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5ba867cf491aaf17b9948f849daa2b222ddf91fc897a97d299a38cc1f6a17c99 |
| hovercard-subject-tag | issue:721535476 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/39266/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d15fe1a7468642fe5034c5facc49975f6b00261759a80a8b265f6b711a2ce775/angular/angular/issues/39266 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d15fe1a7468642fe5034c5facc49975f6b00261759a80a8b265f6b711a2ce775/angular/angular/issues/39266 |
| og:image:alt | Currently the Service Worker will serve the specified index file on navigation requests, checking for updates once the application has started. While this does provide offline support & improves th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | laurentgoudet |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width