I’d like to include some preconnect resource hints on my site so that browsers can (for example) connect to the jQuery CDN before they actually see the script tag that invokes the CDN. I’m not sure whether I should include the “crossorigin” attribute or what its value should be. The spec says, in part,
To initiate a preconnect, the user agent must run these steps:
- Let corsAttributeState be the current state of the element's
- Let credentials be a boolean value set to
- If corsAttributeState is
Anonymousand origin is not equal to current Document's origin, set credentials to
- Attempt to obtain connection with origin and credentials.
I don’t know how to interpret this algorithm. If I’m preconnecting to a CDN, which will let anyone download its content without any sort of credentials, what value should I use for the “crossorigin” attribute?