-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: index.html in root is correctly cached #1266
Conversation
Deployed to https://test-deployment-pr-1266.herokuapp.com/ |
# Service Worker requests should not be changed | ||
location ~* ^/ngsw { | ||
try_files $uri =404; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that a manual request by user to ngsw/state or some internal ones by services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the ones for the ngsw-worker.js
(so the actual service worker which we request in the app.module.ts
) and the request for the ngsw.json
which tracks the cached files and indicates updates which the service worker itself requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to work as described 👍
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
🎉 This PR is included in version 3.6.0-master.14 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Currently our offline functionality still has some limits. To reproduce:
loading...
is shown)This is because the root
index.html
(e.g.https://demo.aam-digital.com/index.html
) is not actively cached by the service worker.This PR changes this and adds correct handling of requests to root without locale.
Try the same with https://test-deployment-pr-1266.herokuapp.com/en-US/ and https://test-deployment-pr-1266.herokuapp.com/ and it should work.
Visible/Frontend Changes
--
Architectural/Backend Changes
index.html
on root (e.g.demo.aam-digital.com
) is not defined in thengsw.json
and only sometimes cached. This is no changed toprefetch
which means it will actively be loaded and cached by the service worker