Skip to content
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

Remove hash part of URL from request URL and client URL #17

Merged
merged 1 commit into from
Aug 21, 2020
Merged

Remove hash part of URL from request URL and client URL #17

merged 1 commit into from
Aug 21, 2020

Conversation

arneschuldt
Copy link
Contributor

Problem

Fragment identifiers (the hash part of the URL) are also part of the service worker request URL. This causes problems when using the sw-appcache-behavior AppCache polyfill with Single-Page Applications (SPA) because the URL including the fragment identifier does not match the URL cached from the manifest.

Related

The same problem had already been identified in GoogleChrome/workbox#488 and GoogleChromeLabs/sw-precache#290.

Solution

This pull request proposes a solution that seems to solve the problem in practical tests.

Tests

The sw-appcache-behavior project already contains automated tests. However, they focus on the tricky part of populating the cache correctly from the manifest. There are currently no existing tests that check whether data is correctly retrieved back from the cache by the service worker.

Hence, we were not able to simply derive a test for the new behaviour proposed in the pull request.

Hopefully, the pull request can still help improve the sw-appcache-behavior.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@arneschuldt
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@jeffposnick jeffposnick self-requested a review August 20, 2020 15:36
Copy link
Contributor

@jeffposnick jeffposnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@jeffposnick jeffposnick merged commit 850dd4c into GoogleChromeLabs:master Aug 21, 2020
@jeffposnick
Copy link
Contributor

This is now in the v0.3.0 release.

@arneschuldt
Copy link
Contributor Author

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants