-
Notifications
You must be signed in to change notification settings - Fork 406
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
Allow multiple Speculation Rules #273
Comments
I noticed this today too, did earlier versions of the API only support one test/test-prerender-only.html can be used to reproduce the issue. Note how in the screenshot below, only |
Yes that's correct. It's a relatively recent change (Chrome 107 I think) that allowed multiple prerenders. |
I've had a look around the repo and made a few changes locally. I think there are a few things we will need to do:
Example of not clearing out the <script type="speculationrules">
{ "prerender": [{ "source": "list", "urls": ["http://localhost:8080/work"] }] }
</script>
<script type="speculationrules">
{ "prerender": [{ "source": "list", "urls": ["http://localhost:8080/work", "http://localhost:8080/contact"] }] }
</script>
<script type="speculationrules">
{ "prerender": [{ "source": "list", "urls": ["http://localhost:8080/work", "http://localhost:8080/contact", "http://localhost:8080/github-stars"] }] }
</script>
<script type="speculationrules">
{ "prerender": [{ "source": "list", "urls": ["http://localhost:8080/work", "http://localhost:8080/contact", "http://localhost:8080/github-stars", "http://localhost:8080/github-stars?no-js"] }] }
</script> |
All that said, I did quite quickly start seeing |
Yeah there's current a limit of 10 prerenders. IMHO that is more than enough, and prerendering even that many (which I could easily see happening if prerendering all in-viewport links) seems like a lot to me. |
Maybe should mv |
Is your feature request related to a problem? Please describe.
According to https://developer.chrome.com/blog/prerender-pages/#multiple-speculation-rules the Speculation API allows multiple Speculation Rules. Right now
prerender: true
can only prerender a single URL in viewport.Describe the solution you'd like
Remove
quicklink/src/index.mjs
Line 247 in e6565ed
Additional context
Would be happy to open a PR for this.
Have a nice weekend
midzer
The text was updated successfully, but these errors were encountered: