-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Move serviceworker to workbox and fix SSE interference #11538
Conversation
Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: go-gitea#11092 Fixes: go-gitea#7372
Confirmed that this solves issue with EventSource |
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.
Obviously can not test every edge case but fixes my issues with SW and populates cache properly as expected.
Should we remove |
In a separate PR, please. |
@guillep2k are you sure? I think it's fine to remove here as it was only used for the serviceworker rendering and added in the original commit so I think it only makes sense to remove it now. |
Removed it. @guillep2k hope it's okay for you 😉 |
One more feature added: Cache will now invalidate if
|
ping LG-TM |
@silverwind please send backport to release/v1.12 :) |
* Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: go-gitea#11092 Fixes: go-gitea#7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162b. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Backport done. I'll follow up with another PR to this, there are some minor fixups to be done, but nothing crucial 😉 |
* Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: #11092 Fixes: #7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162b. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
go-gitea#11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton <art27@cantab.net>
#11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton art27@cantab.net
go-gitea#11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton art27@cantab.net
#11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton art27@cantab.net
* Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: go-gitea#11092 Fixes: go-gitea#7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162b. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
go-gitea#11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton art27@cantab.net
Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests.
This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't.
Fixes: #11092
Fixes: #7372