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

Suggestion: Add more fine-grained prioritization for prefetching #10

Open
cjtenny opened this issue Feb 10, 2021 · 3 comments
Open

Suggestion: Add more fine-grained prioritization for prefetching #10

cjtenny opened this issue Feb 10, 2021 · 3 comments

Comments

@cjtenny
Copy link
Collaborator

cjtenny commented Feb 10, 2021

The example in subresource-loading.md has the following manifest:

    "paths": {
        "a.js": ["bGpobG", "FzZGZq"],
        "b.js": ["bGpobG", "sbnNkd"],
        "style/page.css": ["a2FzaG"],
    }

(implicit: common.js => bGpobG)

However, there's no way to indicate whether a resource is needed immediately or soon here, which would help in batching requests and with page responsiveness. For example, a.js and b.js might depend on common.js to be able to execute, but may also insert loading-wheel.gif into the page when running and be able to start executing / return control to the user before that soft dependency loaded. Similar to priority hints, a mechanism here & in the proposed bundle navigator control mechanism could offer larger sites much needed control to maintain responsiveness while using bundles.

@cjtenny cjtenny changed the title Suggestion: Dependency paths too coarse Suggestion: Dependency pathspec too coarse Feb 10, 2021
@littledan
Copy link
Collaborator

I like this idea. I could imagine that the array could be generalized into a split between initial fetch vs separate prefetch at high/auto/low priority. I think this would fit in pretty cleanly into an extension on top of this proposal (e.g., we could make objects as array elements to specify these priorities, and in the v1, say that objects positioned this way are ignored). What would you think of this as a v2 feature? It's a bit hard to get into priorities before the priority hints proposal is standard, though.

@cjtenny
Copy link
Collaborator Author

cjtenny commented Feb 14, 2021

I think possibly it points to something worth reviewing a little more in a v1 to see if it could be improved.

Thinking more about it, what are the reasons to have dependencies hard-coded in the manifest versus dynamically decided by the client or server? I think the dependency path list is trying to solve two separate problems in one go: batching less-than-full-bundle requests and allowing a CDN to serve bundles without needing to understand dependencies. Could there be a better way to combine those, or offer control separately?

@littledan
Copy link
Collaborator

Well, if you have any other ideas, I would be happy to hear them. The subresource loading section includes multiple schemes to consider, and I would be open to adding others.

@littledan littledan changed the title Suggestion: Dependency pathspec too coarse Suggestion: Add more fine-grained prioritization for prefetching Feb 15, 2021
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

No branches or pull requests

2 participants