Resource Hints Generator: preload, preconnect, dns-prefetch, fetchpriority

Turns a list of URLs into preload, preconnect, dns-prefetch, modulepreload and prefetch tags.

Use the tool

Why this tool exists

Resource hints help when used on the few files that matter and hurt when sprayed everywhere.

The tool picks the as value from the extension, adds crossorigin for fonts, which the browser needs even on the same origin, treats bare origins as preconnect, and warns when you ask for many preloads or origins. You can add fetchpriority="high" to the first image preload.

How to use it

  1. List one URL per line; start a line with the hint name to choose it.
  2. Add options such as as=image or fetchpriority=high after the URL.
  3. Copy the tags into the head, early.
  4. Read the review notes.

Frequently asked questions

Why does a font preload need crossorigin?

Fonts are fetched in CORS mode. Without it the preload is not reused and the font downloads twice.

How many preconnects are too many?

Keep to two to four origins that the page needs immediately.

preconnect or dns-prefetch?

preconnect opens the full connection; dns-prefetch only resolves the name and is a cheap fallback.

Is anything fetched by the tool?

No. It only writes text.