When I first started shipping side projects and indie SaaS products, the most tedious part of the process wasn't writing the actual application code—it was the pre-launch checklist. Specifically, auditing the SEO of my landing pages.
I would manually inspect the DOM, check meta tags, count H1s, verify image alt texts, and ensure my OpenGraph images were rendering correctly. It felt like a massive waste of time. I was spending hours on repetitive, manual checks instead of building features or talking to users. The friction of launching was killing my momentum. So I decided to build something to automate it.
The Cost of Manual SEO Checks
Launching a SaaS without proper SEO is like opening a store in a hidden alley; you might have a great product, but nobody will find it. However, manually checking every single page, especially when you're iterating quickly and deploying multiple times a day, creates a severe bottleneck.
If you ignore these checks, your organic traffic tanks because of simple, fixable errors like missing descriptions or multiple H1 tags. On the flip side, if you do it manually, you lose hours of development time to context switching. The cost of ignoring it is zero visibility; the cost of doing it manually is developer burnout.
I needed a way to run these structural checks instantly, globally, and without spinning up heavy backend infrastructure just to parse some HTML. I wanted a system where I could paste a URL and get immediate feedback, allowing me to fix issues before they ever reached production.
Pushing SEO Analysis to the Edge
To solve this, I leaned into edge computing. Instead of routing SEO analysis requests back to a central Node.js server, I pushed the logic to Cloudflare Workers. This means the analysis runs at the edge, closer to the user, resulting in incredibly low latency worldwide.
The core of this automation is a lightweight Cloudflare Worker that fetches the target page and extracts the necessary SEO metrics. Because I wanted to keep the compute footprint as small as possible, I avoided heavy DOM parsers like JSDOM. Instead, I used targeted regular expressions to extract the data.
Here is the edge worker logic I built:
// Cloudflare Worker for edge SEO analysis
export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname !== '/api/analyze') {
return new Response('Not found', { status: 404 });
}
const targetUrl = url.searchParams.get('url');
if (!targetUrl) {
return new Response(JSON.stringify({ error: 'Missing url' }), {
status: 400,
headers: { 'Content-Type': 'application/json' },
});
}
// Fetch target page at the edge (low latency worldwide)
const response = await fetch(targetUrl, {
cf: { cacheTtl: 300, cacheEverything: true },
});
const html = await response.text();
// Run SEO checks (regex-based, no DOM needed)
const title = html.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1] || '';
const desc = html.match(/<meta[^>]*name=["']description["'][^>]*content=["']([^"']*)["']/i)?.[1] || '';
const h1Count = (html.match(/<h1[ >]/gi) || []).length;
return new Response(JSON.stringify({ title, desc, h1Count }), {
headers: { 'Content-Type': 'application/json' },
});
},
};
Breaking Down the Architecture
There are a few key decisions in this code that make it highly productive for this specific use case.
First, the cf object in the fetch call. By setting cacheTtl and cacheEverything, we instruct the Cloudflare network to cache the HTML response at the edge. If I'm running multiple checks on the same URL while tweaking my Next.js App Router pages, the worker doesn't need to re-fetch the origin server every time.
Second, the regex approach. While regex for parsing HTML is generally frowned upon for complex, unpredictable documents, it works beautifully here. Since I am analyzing pages generated by my own Next.js applications, the HTML structure is highly predictable. This avoids the overhead of loading a virtual DOM environment in the worker, keeping execution times in the single-digit milliseconds.
This edge worker is just one piece of the puzzle. In my broader workflow, I integrated this into a production-ready SaaS boilerplate using Next.js 14+ and TypeScript. Having the edge SEO tools built-in alongside Stripe subscription billing and NextAuth.js means I don't have to wire up webhooks or authentication from scratch every time I start a new project. The boilerplate handles the tedious infrastructure, and the edge worker handles the tedious auditing.
Practical Results and Time Savings
The time savings from this automation were immediate and significant. What used to take me 20 to 30 minutes of manual clicking, inspecting elements, and copying text into a spreadsheet per project now takes less than a second. I just hit the API endpoint, and the JSON response tells me exactly what I need to know.
What surprised me the most was how well the lightweight regex approach held up in practice. I initially thought I would eventually need to migrate to a full DOM parser for edge cases, but because the tool is primarily used for standard React/Next.js server-side rendered output, the structure is consistent.
If I were to change anything about the current implementation, I would probably expand the regex patterns to check for OpenGraph and Twitter Card meta tags, as those are crucial for social sharing. I might also add a check for canonical URLs. However, the core automation of title, description, and heading structure is already doing the heavy lifting for my pre-launch checklist.
Try the Automated SEO Checker
I ended up packaging this edge SEO logic, along with the Next.js App Router setup and Stripe integration, into a comprehensive SaaS starter kit called SaaSLaunch. It's designed to eliminate the repetitive setup phase of building a new SaaS product.
However, you don't need to use a boilerplate to benefit from the SEO automation. I've extracted the core edge analysis logic into a standalone, free tool. You can use it right now to instantly audit your own landing pages, check your meta tags, and verify your heading structure without any manual DOM inspection.
You can try the free SEO Checker here: https://saaslaunch.dev/free-tools/seo-checker
Hopefully, this saves you some time on your next launch so you can get back to building the actual product.
Full disclosure: I'm the developer of SaaSLaunch. I built this because I needed it myself.
Top comments (0)