
Edge Rendering
Serve thousands of city-by-service landing pages from edge templates with fast TTFB and fresh JSON-LD instead of prebuilding static HTML on origin.
Overview
Edge Rendering is an agent skill most often used in Launch (also Operate, Build) that generates and caches dynamic SEO pages at the network edge from templates and edge data stores.
Install
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill edge-renderingWhat is this skill?
- On-demand page generation at the edge from templates plus KV city data and D1 service metadata
- Stale-while-revalidate caching for sub-50ms TTFB while keeping variant content fresh
- JSON-LD and SEO metadata injection in the render pipeline for each matrix cell
- Scales combinatorial patterns (service × city, product × location) without 18k static builds
- Eliminates origin round-trips for segment-specific dynamic HTML
- 18,000+ pages from 116 services across 155+ cities
- sub-50ms TTFB globally at the edge
Adoption & trust: 1 installs on skills.sh; 18 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You need thousands of unique landing URLs but prebuilding static pages or hitting origin on every request is too slow, costly, or stale for SEO.
Who is it for?
Solo builders shipping location- or catalog-matrix SEO (services × cities, products × regions) on Cloudflare Workers or comparable edge platforms.
Skip if: Teams that only need a handful of static marketing pages or heavy personalized dashboards that cannot be safely cached at the edge.
When should I use this skill?
Building or scaling combinatorial SEO or localized landing pages that should render at the edge with structured data rather than on a central origin.
What do I get? / Deliverables
You get an edge render pipeline with template resolution, data injection, JSON-LD, and cache-friendly semantics so matrix pages stay fast and indexable without origin bottlenecks.
- Edge render handler and template pipeline
- Cache and revalidation strategy for matrix URLs
- Per-URL meta tags and JSON-LD output
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Launch because the documented matrix is SEO landing pages with structured data and meta tags served at the edge. Subphase seo fits combinatorial location × service pages, JSON-LD, and global crawlable content—not generic CDN caching alone.
Where it fits
Ship 116 services × 155 cities as crawlable URLs with unique titles and schema without a static export job.
Wire Worker handlers that resolve template + KV city blob + D1 service row into one HTML response.
Tune cache TTL and stale-while-revalidate so edge pages refresh when service or city data changes.
Expand the matrix with new cities or services while keeping one template family and edge cache behavior.
How it compares
Use for programmatic edge HTML and SEO matrices instead of exporting thousands of static files from a CMS on every data change.
Common Questions / FAQ
Who is edge-rendering for?
Indie founders and small teams running edge-hosted sites who must publish large combinatorial SEO surfaces (cities, services, SKUs) with consistent templates and structured data.
When should I use edge-rendering?
At Launch when rolling out geo or category landing grids; during Build when wiring Workers, KV, and D1; and in Operate when tuning stale-while-revalidate and cache keys for fresh local content.
Is edge-rendering safe to install?
Review the Security Audits panel on this Prism page and treat edge data bindings and template code like production paths before enabling wide traffic.
SKILL.md
READMESKILL.md - Edge Rendering
# Edge Rendering Part of [Agent Skills™](https://github.com/itallstartedwithaidea/agent-skills) by [googleadsagent.ai™](https://googleadsagent.ai) ## Description Edge Rendering generates and serves dynamic pages at the network edge, eliminating origin round-trips for content that varies by city, service, or user segment. This skill powers googleadsagent.ai™'s system of 18,000+ pages generated from a matrix of 116 services across 155+ cities, each with unique content, structured data, and SEO metadata—all rendered at the edge with sub-50ms TTFB globally. The city × service page matrix demonstrates the power of edge rendering at scale. Rather than pre-building 18,000 static pages or routing every request to a centralized origin, Workers generate each page on demand using templates, city-specific data from KV, and service metadata from D1. Rendered pages are cached at the edge with stale-while-revalidate semantics, providing instant responses while keeping content fresh. This pattern extends beyond SEO landing pages to any content that follows a combinatorial template: product × location pages, event × venue pages, or service × industry pages. The edge rendering pipeline handles template resolution, data injection, structured data generation (JSON-LD), meta tag construction, and cache management as a unified system. ## Use When - Generating pages from a combinatorial matrix (city × service, product × category) - Serving SEO-critical content that must have fast TTFB globally - Building landing page systems with thousands of unique URLs - Replacing static site generation that takes hours to build - Implementing stale-while-revalidate caching at the edge - Rendering structured data (JSON-LD) dynamically per page ## How It Works ```mermaid graph TD A[Request: /google-ads/chicago] --> B[Worker: Parse city + service] B --> C{Edge Cache Hit?} C -->|Hit| D[Return Cached HTML] C -->|Miss| E[Fetch City Data from KV] E --> F[Fetch Service Data from D1] F --> G[Render Template] G --> H[Inject JSON-LD Structured Data] H --> I[Generate Meta Tags] I --> J[Cache at Edge] J --> K[Return Fresh HTML] D --> L[Background: Revalidate if Stale] ``` Every request resolves to a (city, service) tuple. The Worker checks the edge cache first. On miss, it fetches city and service data in parallel, renders the template, injects structured data, and caches the result. Stale entries trigger background revalidation without blocking the response. ## Implementation ```typescript export default { async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> { const url = new URL(request.url); const [, service, city] = url.pathname.split("/"); const cacheKey = new Request(url.toString()); const cache = caches.default; let response = await cache.match(cacheKey); if (response) { const age = parseInt(response.headers.get("age") ?? "0"); if (age > 3600) { ctx.waitUntil(revalidate(env, cache, cacheKey, service, city)); } return response; } return revalidate(env, cache, cacheKey, service, city); }, } satisfies ExportedHandler<Env>; async function revalidate( env: Env, cache: Cache, cacheKey: Request, service: string, city: string ): Promise<Response> { const [cityData, serviceData] = await Promise.all([ env.CITY_KV.get<CityData>(city, "json"), env.DB.prepare("SELECT * FROM services WHERE slug = ?").bind(service).first<ServiceData>(), ]); if (!cityData || !serviceData) { return new Response("Not Found", { status: 404 }); } const html = renderPage(cityData, serviceData); const response = new Response(html, { headers: { "Content-Type": "text/html;charset=UTF-8", "Cache-Control": "p