- Home
- Skills
- Harborgrid Justin
- Lexiflow Premium
- Advanced Ssr Cache Design
advanced-ssr-cache-design_skill
- HTML
1
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill harborgrid-justin/lexiflow-premium --skill advanced-ssr-cache-design- SKILL.md868 B
Overview
This skill engineers server-side rendering (SSR) cache strategies that remain correct during concurrent updates and streaming responses. It focuses on deterministic cache keys, safe invalidation, and policies that integrate with React 18 streaming. The goal is repeatable correctness, measurable hit ratios, and practical guidance for distributed render nodes.
How this skill works
The skill inspects routing, personalization signals, and request metadata to build deterministic cache keys that avoid accidental collisions. It embeds invalidation hooks and versioning to ensure deterministic outcomes when content changes concurrently. It also integrates cache policies with streaming SSR so partial responses and progressive rendering honor cache semantics and safety guarantees.
When to use it
- High-traffic sites using SSR with personalized or user-specific fragments
- Applications using React 18 streaming where partial HTML can be cached
- Distributed rendering setups with multiple nodes serving cached results
- Systems that must prove correctness under concurrent updates and invalidations
Best practices
- Include route, critical query params, auth scope, and feature flags in cache keys to prevent incorrect hits
- Prefer immutable fragment caching plus small mutable placeholders instead of full-page caching for heavy personalization
- Use explicit versioning or monotonic timestamps for deterministic invalidation rather than time-based TTLs alone
- Run correctness tests simulating concurrent updates and stream interleaving before enabling cache in production
- Measure cache hit ratios and origin load before/after tuning; iterate on key shape and TTLs based on real traffic patterns
Example use cases
- Cache static header and layout markup while streaming user-specific main content as placeholders
- Cache pre-rendered policy documents in a legal platform with per-tenant routing keys and tenant version tags
- Implement edge node fragment caches with coherent invalidation via a signed version token distributed through a central store
- Derive TTLs by modeling churn: simulate update rates and choose TTL that balances staleness risk vs origin load
FAQ
Build keys that include personalization scope and a version token; cache only fragments safe to reuse while rendering sensitive parts per request.
Can streaming SSR be cached safely?
Yes—cache complete safe fragments and ensure streaming boundaries are deterministic. Use versioning and tests that simulate partial-response interleaving to confirm correctness.