Incremental Sitemap Engine — Cold/Hot XML & <1ms Zero-Copy Nginx Serving
High-performance Cold/Hot incremental XML sitemap generator and <1ms TTFB static edge serving by Dương Phúc Khánh (khanhdp.com).
Free
Works with the AI Agents you already use
About this skill
When large content websites (blogs, e-commerce, news platforms with 10k–500k+ URLs) rely on framework-level dynamic SSR routes (e.g. Next.js src/app/api/sitemaps/.../route.ts or Nuxt/Remix route handlers) to generate XML sitemaps on-demand:
- Massive CPU & Database Thrashing: When Googlebot, Bingbot, or Ahrefs crawl sitemaps, they request dozens of weekly/monthly archive XML files concurrently. Each request triggers database pagination (fetching thousands of rows), JSON serialization, and heavy XML string concatenation in Node.js/Bun.
- Gateway Timeouts (504s) & De-indexing: The Node.js event loop blocks, database connections exhaust, and responses take 5–15 seconds or timeout, causing search engines to abandon indexing.
- 95% Waste on Immutable Historical Data: Articles published in past months/years are closed and immutable. Recomputing them dynamically on every crawl is pure waste.
This skill standardizes the Cold/Hot Incremental Generation + Nginx Zero-Copy Static Serving pattern to achieve sub-second delta builds and < 1ms TTFB under infinite crawler concurrency.
[!IMPORTANT] Service Placement Rule (CMS/Backend-Driven, Zero-FE Overhead): Always place the sitemap generator engine, database queries, and
.sitemap-manifest.jsonstate inside the CMS / Backend service that owns the database and content lifecycles (e.g.,index-admin-cms), never inside the Frontend SSR app (index-web):
- Event-Driven Auto-Sync: Hook debounced incremental regeneration (
scheduleIncrementalSitemapSync) directly into CMS publish/update/delete lifecycles (lifecycles.ts) right before CDN cache purge.- Trigger & Status API: Expose
POST /api/articles/sitemap/triggerandGET /api/articles/sitemap/statuson the CMS so Frontend or Ops only makes a single lightweight HTTP call if a manual trigger is needed.- Zero Frontend Loops: Remove multi-query
lastmodprobes and unboundedPromise.allpagination loops from Frontend SSR routes to prevent socket pool exhaustion and Cloudflare 524 timeouts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account