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

[Hint] Avoid URL-versioning for some files #2496

Open
Malvoz opened this issue May 23, 2019 · 3 comments
Open

[Hint] Avoid URL-versioning for some files #2496

Malvoz opened this issue May 23, 2019 · 3 comments

Comments

@Malvoz
Copy link
Member

Malvoz commented May 23, 2019

It's common for developers to version resources (call it: fingerprinting, url hashing, file revving, url query string parameters etc.). This may cause issues for some types of files, which to my knowledge include:

Related issue(?): #1307

As for the potential hint implementation, I assume that because serviceworkers do not have a unique MIME type I suppose you'd want to look for the common file-names sw.js, service(-/_)worker.js. And although Web App Manifest defines the application/manifest+json for .webmanifest it is common for developers to use manifest.json aswell.

✌️

@Malvoz
Copy link
Member Author

Malvoz commented May 23, 2019

Oh and to clarify, whilst you should not rev these files, the natural question is how do we as developers (instantly) update them then?

For serviceworker.js

For .webmanifest

That's not all that clear (aside from a user re-installing the PWA?), as the issue I linked to in my first comment is the sole issue trying to solve how developers can update the manifest - without introducing ways for developers to abuse the fact that a user may have a PWA installed but a malicious developer updates (e.g.) icons to trick a user~.

@molant
Copy link
Member

molant commented May 23, 2019

I've been bitten by this so many times... I believe we still have some issue with the manifest in webhint.io and one of the icons not existing anymore (or something like that).

So this should be a change in http-cache that should also not tell you to set a long-lived cache for those assets I assume.

A user can now avoid the http-cache for a specific URL via the ignoredUrls property but we should add some defaults. Question is: should we add another option to expand these defaults or point users to the ignoredUrls property?
Also we should look at the most common names for service workers. Probably need to query HTTPArchive for that.

@webhintio/contributors thoughts?

Thanks!

@Malvoz
Copy link
Member Author

Malvoz commented Jul 5, 2019

Also we should look at the most common names for service workers. Probably need to query HTTPArchive for that.

When browsers support it, you could check for the serviceworker request destination (and manifest respectively) as advertised in the Sec-Fetch-Dest HTTP header.

It's currently available behind #enable-experimental-web-platform-features in Chrome.

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

No branches or pull requests

2 participants