AgenticWebScore
Scan

Content Accessibility · Recommended · Medium impact

Token efficiency (content-to-markup ratio)

A bloated DOM wastes an agent's context window.

  • Recommended
  • Medium impact
  • Draft standard
Token efficiency (content-to-markup ratio) — Property, Value
Property Value
Check idtoken-efficiency
DimensionContent Accessibility (22%)
TierRecommended — pool 20 pts
Weight inside tier2
ImpactMedium
MaturityDraft — A published specification that is not yet ratified.
ConditionalNo
Publishing skilltoken-efficiency
Standards—

What is measured

The scanner strips <script>, <style>, <svg> and <template> blocks from the homepage /, removes the remaining tags, normalises whitespace and divides visible characters by the raw HTML size. Pass when text is at least 15% of the page; partial between 8% and 14.9%; fail below 8%, where the markup an agent must read outweighs the content.

Reproduce it yourself

You do not have to take our word for any of this. Run the same measurement against your own domain:

              DOMAIN="https://example.com"
html=$(curl -sL "$DOMAIN/"); text=$(printf '%s' "$html" | perl -0777 -pe 's{<(script|style|svg|template|noscript)[^>]*>.*?</\1>}{}gsi; s/<[^>]*>/ /g; s/\s+/ /g'); printf 'text=%d chars, html=%d chars, ratio=%d%%\n' "${#text}" "${#html}" "$(( ${#text} * 100 / ${#html} ))"
            

The fix

This is the artifact to ship. It is the complete change, not a description of one.

              // scripts/tighten-html.mjs — run after the build over every emitted page.
import { readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { minify } from 'html-minifier-terser';

const walk = (dir) => readdirSync(dir).flatMap((name) => {
  const p = join(dir, name);
  return statSync(p).isDirectory() ? walk(p) : p.endsWith('.html') ? [p] : [];
});

for (const file of walk('dist')) {
  const before = readFileSync(file, 'utf8');
  const after = await minify(before, {
    collapseWhitespace: true,
    removeComments: true,
    removeRedundantAttributes: true,
    minifyCSS: true,
    minifyJS: true,
  });
  writeFileSync(file, after);
  console.log(`${file}: ${before.length} -> ${after.length} bytes`);
}
            

Related checks

Related checks — Check, Tier, Impact, Same skill
Check Tier Impact Same skill
markdown-negotiation — Markdown content negotiationRecommendedCritical—
headings — Semantic heading structureEssentialHigh—
meta — Title and summary metadataEssentialHigh—
jsonld — JSON-LD structured dataEssentialCritical—
faq-schema — FAQ / question-answer schemaRecommendedHigh—
breadcrumb — Breadcrumb / navigation schemaEmergingLow—
summary — Prominent summary blockRecommendedMedium—
lang — Language declaration and multilingual accessRecommendedMedium—