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

  1. Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
  2. Enter rel, href according to the field table, then run the tool.
  3. Read dnsPrefetchRelation, nonemptyHref, hintPresent. Check the effective state, recognized-token flags or generated markup against the rules below.
  4. Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
Input fieldMeaningValue type and boundsRequirement
relRelstring; maximum text length 100000Required
hrefHrefstring; maximum text length 100000Required

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 fieldMeaningValue type
dnsPrefetchRelationDns Prefetch Relationboolean
nonemptyHrefNonempty Hrefboolean
hintPresentHint Presentboolean
json
{
  "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

  1. HTML Standard: dns-prefetch rel Usage Lookup — WHATWG

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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies