ampproject / ampproject/amp-toolbox
Consider using `preconnect` for browsers without `preload` support
- Dominant language
- HTML
- Stars
- 459
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
The rewritten AMP URLs only contain `preload` tags. However, some browsers do not support this, or only support it behind a flag that disables it by default right now.
https://github.com/ampproject/amp-toolbox/blob/bf92d77fd1f53c54519bf8bed2be05b0bca26004/packages/optimizer/lib/transformers/RewriteAmpUrls.js#L163-L172
We should consider adding `preconnect` tags for the AMP host domain(s) to improve the loading behaviour in that case.
Contributor guide
Research direction
Start with packages/optimizer/lib/transformers/RewriteAmpUrls.js at lines 163-172, where rewritten AMP URLs currently produce preload tags. Review how the transformer handles AMP host domains and define the expected preconnect output for browsers without usable preload support. Done when the generated markup provides the requested fallback behavior and validation covers the resulting tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100