dns-prefetch rel Usage Lookup
Identifies dns-prefetch in a parsed link relation and a supplied nonempty href. This classifies the hint only and performs no DNS or URL validation.
Description
DNS prefetch is a resource hint that can let a browser resolve a host before a later request.
DNS prefetch is a resource hint that can let a browser resolve a host before a later request. A supplied link’s relation and destination reveal whether the local hint pattern is present.1
The tool returns dnsPrefetchRelation, nonemptyHref, hintPresent. The fields describe the supplied local pattern or effective state, or contain the formatted markup shown below.
When to use dns-prefetch rel Usage Lookup
Use this for the following task: Identifies dns-prefetch in a parsed link relation and a supplied nonempty href. This classifies the hint only and performs no DNS or URL validation. Provide the requested local fields extracted from the relevant element or attribute.
How to use dns-prefetch rel Usage Lookup and understand its results
- Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
- Enter rel, href according to the field table, then run the tool.
- Read dnsPrefetchRelation, nonemptyHref, hintPresent. Check the effective state, recognized-token flags or generated markup against the rules below.
- Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| rel | Rel | string; maximum text length 100000 | Required |
| href | Href | string; maximum text length 100000 | Required |
Provide rel and href. Split relation tokens on HTML ASCII whitespace, fold case and independently check href token presence.
hintPresent = rel contains dns-prefetch AND href has non-whitespace content The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| dnsPrefetchRelation | Dns Prefetch Relation | boolean |
| nonemptyHref | Nonempty Href | boolean |
| hintPresent | Hint Present | boolean |
{
"input": {
"rel": "dns-prefetch",
"href": "//assets.example.org"
},
"output": {
"dnsPrefetchRelation": true,
"nonemptyHref": true,
"hintPresent": true
}
} Limitations and assumptions
This performs no DNS lookup and does not validate URL syntax or predict whether a browser honors the hint.
The tool does not fetch a page, run a browser or validate an entire HTML document. Malformed tool requests produce input errors; valid requests can still report unrecognized values or failed local checks.
Alternative or Complementary methods
Choose link preload as= Types List when you need its operation: Checks the six current HTML preload as destinations and translates fetch to the empty Fetch destination. Modulepreload has a separate vocabulary and is outside this lookup. Choose Web App Manifest link rel Lookup for the complementary operation: Checks a parsed link for the manifest relation and a nonempty href. This local check does not fetch or validate the manifest document.
Background reference: HTML Standard: dns-prefetch rel Usage Lookup.
References
Similar or alternative tools
- link preload as= Types List
Checks the six current HTML preload as destinations and translates fetch to the empty Fetch destination. Modulepreload has a separate vocabulary and is outside this lookup.
- Web App Manifest link rel Lookup
Checks a parsed link for the manifest relation and a nonempty href. This local check does not fetch or validate the manifest document.