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

HTML pages added to cache via manifest attribute still contain the hash fragment of the href #31

Closed
mfulton26 opened this issue May 3, 2021 · 0 comments · Fixed by #39
Assignees
Labels

Comments

@mfulton26
Copy link

mfulton26 commented May 3, 2021

Work was done in #17 to remove hash part of URL from request URL and client URL but this same hash removal isn't being done for HTML pages added to the cache via the manifest attribute.

e.g.

async function updateManifestAssociationForCurrentPage(
manifestUrl: string,
hash: string,
) {
const pageURLToManifestURL: PageURLToManifestURL =
await storage.get('PageURLToManifestURL');
pageURLToManifestURL[location.href] = manifestUrl;
await Promise.all([
storage.set('PageURLToManifestURL', pageURLToManifestURL),
addToCache(hash, [location.href]),
]);
}

There are likely other places that need to be updated too (e.g. in the service worker fetch).

This causes apps that load from the network with a hash fragment to not being able to retrieved from cache due to mismatching key. My team is attempting to work around this for now by changing our root URL to not have a hash fragment but this may not work in other applications or long term for my team. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants