Running an 8-layer observability audit (Cloudflare GraphQL, live curl probes, GA4, Search Console, and Clarity session telemetry) on a production Nuxt 4 site surfaced three subtle issues that standard uptime checks completely missed. Here is what broke, why it happened, and how we fixed all three with zero downtime.
1. Why mem_limit: 512m Still OOM-Crashes Node.js 20 at ~256MB
Cloudflare edge analytics flagged exactly 16 Origin 502 errors over 7 days, even though live probes returned 200 OK and all four GitHub Actions deployments during the week were clean.
Cross-referencing Cloudflare's originResponseStatus timestamps against Nginx and Docker logs proved that zero errors occurred during deployments. All 16 502s happened inside a single 5-second window when a single IP requested 16+ cache-bypassed SSR paths concurrently:
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory Mark-Compact 251.2 (258.0) -> 249.8 (258.0) MB The Fix
In a 512MB container, Node.js v20 caps its default V8 old-space heap at roughly half the container limit (~256MB). Concurrent SSR rendering + SQLite queries hit that ceiling while half the container's memory sat idle.
- Raised container headroom (
mem_limit: 768m) and explicitly passedNODE_OPTIONS=--max-old-space-size=512. - Replaced single-container restarts with an atomic Blue-Green Nginx cutover (
blue:3002andgreen:3012) usingproxy_next_upstream error timeout invalid_header http_502 http_503, warming up SSR + SQLite routes before runningnginx -s reload. Live continuous probing across the deploy window recorded 218 / 218 HTTP 200 responses (0 502s).
2. Nitro prerender: true Routes Bypassing server/middleware
To keep internal QA traffic out of analytics and edge caches, we run dual-layer exclusion:
- Layer 1 (Cloudflare Cache Rule): Bypass Edge SWR when internal cookies or query flags are present.
- Layer 2 (Origin Guard): Emit
Cache-Control: private, no-cache, no-storeandCDN-Cache-Control: no-store.
During automated header audits, dynamic SSR routes passed, but /about (prerender: true) returned public SWR headers to internal requests. Because Nitro's serveStatic serves pre-built HTML early, relying solely on event.context populated in server/middleware/ left prerendered routes unguarded.
Moving internal-traffic detection into an idempotent utility called inside both a Nitro request hook and the response-header plugin's fallback path brought prerendered and SSR routes to 100% parity.
3. Fixing a 21.4% "Dead Click" Rate on Technical Diagrams
After a post on Hybrid Photo Search & Zero-ms Lightboxes hit the front page of GeekNews, Clarity showed 0 script errors—yet logged a 21.4% Dead Click rate.
Readers of an engineering post about lightboxes naturally clicked inline architecture <svg> diagrams and screenshots expecting them to zoom, while non-interactive metadata badges had ambiguous hover states.
We extracted a unified useArticleLightbox composable + accessible modal (ESC, arrow navigation, focus trapping, FIT vs 1:1 toggle, 44x44px touch targets) covering cover art, Markdown <ProseImg>, raw <img>, and inline content <svg> diagrams with cursor: zoom-in, while enforcing cursor: default on non-clickable UI cards.
If you also build visual interactive tools on Nuxt, you can see the companion SVG canvas approach in action on our browser-based Studio Photo Diagram tool and the PhotoJob Nuxt + PostgreSQL architecture case study.

