w3c / wpub

W3C Web Publications
https://w3c.github.io/wpub/
Other
79 stars 19 forks source link

manifest: requirements for offline #22

Closed TzviyaSiegman closed 6 years ago

TzviyaSiegman commented 7 years ago

from https://github.com/w3c/wpub/issues/15#issuecomment-320729321 by @bduga

There is no way to crawl a script and find all the resources it might use or cause to be used. If all secondary resources are not listed, it is not possible to cache a WP offline. I think we either list all resources, or abandon deterministic offline caching.

To be discussed: which resources should be listed in manifest

BigBlueHat commented 7 years ago

Using a script to load resources and scripts would be (and is often now) considered an anti-pattern that limits the ability of the browsers to help developers. Things like <script type="module"> and the like are in the works precisely to keep developers from falling into JS-only mode.

It seems safe to say that "deterministic offline caching" will do what it can based on the spec we right, but if developers Do It Wrong their apps (and more importantly their users!) will suffer the consequences.

BigBlueHat commented 7 years ago

Also, Chrom(ium) is working on a new "offliner" system to replace (or rather enhance for limited space/processing scenarios) the current rel="prerender" based system it's using now.

Here's the conversation about the new system.

And some of the code they're moving toward.

Certainly it would be worth connecting with some of these developers to see where things overlap in our ideal world and what they have on hand now.

mattgarrish commented 7 years ago

I confess I don't understand how all resources can be cached. If the needed resource is dependent on user interaction, for example, you can't know what it is until the user interacts with the interface. There might also be context-dependent ways of calling such a resource that can't all be represented in a manifest. All you can know in some cases is the script that will be called, not what it will call.

And I don't know that we need to optimize web publications in a way browsers don't. If a script has no value offline, it seems like that should probably be a property that HTML defines for the script element, as dropping the file from the cache doesn't remove the element from the DOM. We'd only be "optimizing" one side of the problem.

baldurbjarnason commented 7 years ago

@BigBlueHat

Using a script to load resources and scripts would be (and is often now) considered an anti-pattern that limits the ability of the browsers to help developers. Things like Githubissues.

  • Githubissues is a development platform for aggregating issues.