Detecting a Website's Tech Stack from HTML, Headers and Cookies
Fetch a page and you receive more than its content. The response carries headers describing who served it, cookies named by the framework that set them, asset paths shaped by a build tool, and markup carrying the fingerprints of whatever generated it. None of it is hidden, and collectively it describes the stack in reasonable detail.
Building something that reads those signals is a good exercise in a general engineering skill: reasoning under uncertainty. Almost no individual signal is conclusive, and the difference between a useful tool and a misleading one is entirely in how it combines and qualifies them.
Where the signals live
| Source | What it reveals | Reliability |
|---|---|---|
| Response headers | Server software, framework hints, caching layer | Moderate - often removed or deliberately misleading |
| Cookie names | Session frameworks and platforms with distinctive prefixes | High - these are rarely renamed |
| Asset path conventions | Build tooling and framework, from directory structure | High - hard to change without breaking the build |
| Build manifests and bundles | Framework and sometimes its major version | Very high when present |
| Generator metadata in markup | The CMS that produced the page | Moderate - accurate when present, often stale |
| Class naming conventions | UI framework | Low on its own, useful in combination |
| Security and cache headers | CDN, edge platform, hosting provider | High for the edge, silent about the origin |
The reliability column is the important one. Header values are trivially edited and frequently stripped for exactly this reason, whereas a build tool's asset directory layout is load-bearing - changing it to hide from detection would mean changing the build.
Score, do not conclude
The instinct is to write a chain of checks that each set a flag. It produces confident output and it is wrong often enough to matter, because one weak signal will happily override the absence of five strong ones.
// Each signal contributes weight rather than deciding
const SIGNALS = [
{ tech: 'FrameworkX', weight: 0.9, test: (r) => r.paths.some(p => p.startsWith('/_fx/')) },
{ tech: 'FrameworkX', weight: 0.6, test: (r) => 'x-fx-cache' in r.headers },
{ tech: 'FrameworkX', weight: 0.2, test: (r) => r.html.includes('data-fx-root') },
];
// Combine so that several weak signals never outrank one strong one
function confidence(hits) {
return 1 - hits.reduce((acc, h) => acc * (1 - h.weight), 1);
}Reporting a number rather than a boolean also changes the interface for the better. Detected with high confidence, likely, and possible are three genuinely different statements, and collapsing them into one loses the information that makes the output usable.
The false positives that matter
- Edge headers describe the CDN, not the origin. A site behind a caching provider tells you about the provider and almost nothing about what runs behind it.
- A vendored copy of a library looks identical to the library, but the site may be running a fork that is years old.
- Generator metadata survives migrations. A page can announce a CMS that was replaced two years ago.
- Marketing pages and the application behind the login are frequently different stacks entirely, and you only ever see the first.
- Reverse proxies can present headers from one technology while another serves the request.
- Version numbers in asset paths are often build identifiers rather than framework versions.
The marketing-versus-application split is worth calling out, because it invalidates the most common use of these tools. The public home page of a large organisation is frequently a separate site from the product, and detecting the home page's stack says nothing about the system anyone cares about.
What a single fetch cannot see
The limits are as important as the capabilities, and they follow from one fact: a server-side fetch receives the initial document, not a rendered page.
| Not detectable this way | Why |
|---|---|
| Anything loaded by client-side JavaScript | The script never runs, so its effects never appear |
| Runtime globals a browser would expose | Those exist only after execution |
| The backend language behind a proxy | The proxy answers, and it is not obliged to say |
| Anything behind authentication | The response is a login page, describing the login page |
| Database, queue, and internal services | Nothing about them reaches the client |
| Exact versions, most of the time | Version strings are the first thing removed |
This is the single most important thing to communicate in the output. Not detected must never be presented as not present - it means no evidence was found in one document, which is a much weaker statement. It is the same discipline as distinguishing a rule that decided no from a rule that never ran: absence of evidence and evidence of absence are different results and should look different.
Why this needs a server at all
Browsers will not let a page fetch an arbitrary other origin, so any tool doing this needs a server-side request - which in an otherwise client-side application is a deliberate exception that has to be bounded and protected. An endpoint that fetches a user-supplied address is the one piece of the system genuinely worth attacking, and it needs scheme restrictions, address filtering, redirect re-validation, timeouts and response size limits before it is safe to expose.
Restraint is part of the design
This kind of analysis should behave like a considerate visitor, and the constraints that achieve that are worth building in from the start rather than adding after a complaint.
- Fetch a single page, on explicit request, and never follow links to discover more.
- Identify the request honestly rather than imitating an ordinary browser.
- Respect the site's stated crawling preferences, and say so when they prevent the analysis.
- Rate limit per user and in aggregate, so the tool cannot become a source of load.
- Cache results briefly, so repeated analysis of the same address costs one request rather than many.
- Set a strict timeout and give up quietly rather than retrying.
One page requested deliberately by someone evaluating a site is ordinary web use. Anything that discovers and follows links is a crawler, which is a different thing with different obligations, and the distinction should be built into the tool rather than left to the user's good intentions.
Conclusion
Technology detection is an exercise in weighing evidence, not in pattern matching. Prefer signals a site cannot change without changing its build, score them rather than concluding from any one, and be explicit about confidence. Above all, be honest about the boundaries: a single document shows you the edge and the initial markup, and it is silent about everything client-rendered, authenticated, or internal - which is most of what a real system is made of.