[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBJA0D51THQQ3ZXQVV39HG":3,"skill-same:01M6EBJA0D51THQQ3ZXQVV39HG":128},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":42,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6EBJA0D51THQQ3ZXQVV39HG","nestjs-caching",null,"Multi-level caching, Invalidation patterns, and Stampede protection. Use when implementing multi-level caching or cache invalidation strategies in NestJS. (triggers: **\u002F*.service.ts, **\u002F*.interceptor.ts, CacheInterceptor, CacheTTL, Redis, stale-while-revalidate)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-caching\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"nestjs","caching","nestjs caching","cache","redis","use","stale","protection","patterns","strategies","service","triggers","multi","2026-11-10 10:12:30",false,"---\nname: nestjs-caching\ndescription: \"Multi-level caching, Invalidation patterns, and Stampede protection. Use when implementing multi-level caching or cache invalidation strategies in NestJS. (triggers: **\u002F*.service.ts, **\u002F*.interceptor.ts, CacheInterceptor, CacheTTL, Redis, stale-while-revalidate)\"\n---\n\n# Caching & Redis Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nCaching strategies and Redis integration patterns for high-performance NestJS applications.\n\n## Caching Strategy\n\n- **Layering**: Use **Multi-Level Caching** for high-traffic read endpoints.\n  - **L1 (Local)**: In-Memory (Node.js heap). Ultra-fast, no network. Ideal for config\u002Fstatic data. Use `lru-cache`.\n  - **L2 (Distributed)**: Redis. Shared across pods.\n- **Pattern**: Implement **Stale-While-Revalidate** where possible to avoid latency spikes during cache misses.\n\n## NestJS Implementation\n\n- **Library**: Use `cache-manager` with `cache-manager-redis-yet` (Recommended over `cache-manager-redis-store` for better V4 support and stability).\n- **Interceptors**: Use `@UseInterceptors(CacheInterceptor)` for simple GET responses.\n  - **Warning**: By default, this uses the URL as the key. Ensure consistent query param ordering or custom key generators.\n- **Decorators**: Standardize custom cache keys.\n\n  ```typescript\n  @CacheKey('users_list')\n  @CacheTTL(300) \u002F\u002F 5 minutes\n  findAll() { ... }\n  ```\n\n## Redis Data Structures (Expert)\n\n- Don't just use `GET\u002FSET`.\n- **Hash (`HSET`)**: Storing objects (User profiles). Allows partial updates (`HSET user:1 lastLogin result`) without serialization overhead.\n- **Set (`SADD`)**: Unique collections (e.g., \"Online User IDs\"). O(1) membership checks.\n- **Sorted Set (`ZADD`)**: Priority queues, Leaderboards, or Rate Limiting windows.\n\n## Invalidation Patterns\n\n- **Problem**: \"There are only two hard things in Computer Science: cache invalidation and naming things.\"\n- **Tagging**: Since Redis doesn't support wildcards efficiently (`KEYS` is O(N) - bans in PROD), use **Sets** to group keys.\n  - _Create_: `SADD post:1:tags cache:post:1`\n  - _Invalidate_: Fetch tags from Set, then `DEL` usage keys.\n- **Event-Driven**: Listen to Domain Events (`UserUpdated`) to trigger invalidation asynchronously.\n\n## Stampede Protection\n\n- **Jitter**: Add random variance to TTLs (e.g., 300s ± 10s) to prevent all keys expiring simultaneously.\n- **Locking**: If a key is missing, **one** process computes it while others wait or return stale. (Complex, often handled by `swr` libraries).\n\n\n## Anti-Patterns\n\n- **No KEYS in production**: Use SET-based tag grouping for cache invalidation; KEYS is O(N).\n- **No fixed TTLs on grouped caches**: Add jitter (±10s) to prevent simultaneous stampede.\n- **No MemoryStorage for multi-pod**: Use Redis store; in-memory cache is not shared across pods.\n\n","# Caching & Redis Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nCaching strategies and Redis integration patterns for high-performance NestJS applications.\n\n## Caching Strategy\n\n- **Layering**: Use **Multi-Level Caching** for high-traffic read endpoints.\n  - **L1 (Local)**: In-Memory (Node.js heap). Ultra-fast, no network. Ideal for config\u002Fstatic data. Use `lru-cache`.\n  - **L2 (Distributed)**: Redis. Shared across pods.\n- **Pattern**: Implement **Stale-While-Revalidate** where possible to avoid latency spikes during cache misses.\n\n## NestJS Implementation\n\n- **Library**: Use `cache-manager` with `cache-manager-redis-yet` (Recommended over `cache-manager-redis-store` for better V4 support and stability).\n- **Interceptors**: Use `@UseInterceptors(CacheInterceptor)` for simple GET responses.\n  - **Warning**: By default, this uses the URL as the key. Ensure consistent query param ordering or custom key generators.\n- **Decorators**: Standardize custom cache keys.\n\n  ```typescript\n  @CacheKey('users_list')\n  @CacheTTL(300) \u002F\u002F 5 minutes\n  findAll() { ... }\n  ```\n\n## Redis Data Structures (Expert)\n\n- Don't just use `GET\u002FSET`.\n- **Hash (`HSET`)**: Storing objects (User profiles). Allows partial updates (`HSET user:1 lastLogin result`) without serialization overhead.\n- **Set (`SADD`)**: Unique collections (e.g., \"Online User IDs\"). O(1) membership checks.\n- **Sorted Set (`ZADD`)**: Priority queues, Leaderboards, or Rate Limiting windows.\n\n## Invalidation Patterns\n\n- **Problem**: \"There are only two hard things in Computer Science: cache invalidation and naming things.\"\n- **Tagging**: Since Redis doesn't support wildcards efficiently (`KEYS` is O(N) - bans in PROD), use **Sets** to group keys.\n  - _Create_: `SADD post:1:tags cache:post:1`\n  - _Invalidate_: Fetch tags from Set, then `DEL` usage keys.\n- **Event-Driven**: Listen to Domain Events (`UserUpdated`) to trigger invalidation asynchronously.\n\n## Stampede Protection\n\n- **Jitter**: Add random variance to TTLs (e.g., 300s ± 10s) to prevent all keys expiring simultaneously.\n- **Locking**: If a key is missing, **one** process computes it while others wait or return stale. (Complex, often handled by `swr` libraries).\n\n\n## Anti-Patterns\n\n- **No KEYS in production**: Use SET-based tag grouping for cache invalidation; KEYS is O(N).\n- **No fixed TTLs on grouped caches**: Add jitter (±10s) to prevent simultaneous stampede.\n- **No MemoryStorage for multi-pod**: Use Redis store; in-memory cache is not shared across pods.\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-caching",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill nestjs-caching",{"tool":52,"command":53},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill nestjs-caching",{"tool":55,"command":56},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill nestjs-caching","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-caching\u002FSKILL.md",true,[60,66,70,74,78,82,86,90,94,100,104,108,112,116,120,124],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fcoordinator_runtime_contract.md","REFERENCE","参考文档",2707,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fcoordinator_runtime_contract.md",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fcoordinator_summary_contract.md",1009,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fcoordinator_summary_contract.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fdocs_generation_summary_contract.md",535,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fdocs_generation_summary_contract.md",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fdocs_pipeline_runtime_contract.md",954,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fdocs_pipeline_runtime_contract.md",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fdocs_quality_contract.md",2236,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fdocs_quality_contract.md",{"path":83,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fdocumentation_creation.md",4417,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fdocumentation_creation.md",{"path":87,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Flegacy_detection_patterns.md",12099,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Flegacy_detection_patterns.md",{"path":91,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fmeta_analysis_protocol.md",1509,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fmeta_analysis_protocol.md",{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fscripts\u002Fdocs-quality\u002Fcli.mjs","SCRIPT","脚本",3241,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fscripts\u002Fdocs-quality\u002Fcli.mjs",{"path":101,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fscripts\u002Fdocs-quality\u002Flib\u002Fmanifest.mjs",4153,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fscripts\u002Fdocs-quality\u002Flib\u002Fmanifest.mjs",{"path":105,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fscripts\u002Fdocs-quality\u002Flib\u002Frules.mjs",2038,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fscripts\u002Fdocs-quality\u002Flib\u002Frules.mjs",{"path":109,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fscripts\u002Fdocs-quality\u002Flib\u002Fverify.mjs",12636,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Fscripts\u002Fdocs-quality\u002Flib\u002Fverify.mjs",{"path":113,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Ftemplates\u002Fadr_template.md",2940,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Ftemplates\u002Fadr_template.md",{"path":117,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":118,"sourceHtmlUrl":119},"references\u002Ftemplates\u002Fguide_template.md",3177,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Ftemplates\u002Fguide_template.md",{"path":121,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":122,"sourceHtmlUrl":123},"references\u002Ftemplates\u002Fmanual_template.md",4692,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Ftemplates\u002Fmanual_template.md",{"path":125,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Ftemplates\u002Fresearch_template.md",3100,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Fdocumentation-pipeline\u002Fskills\u002Fln-100-documents-pipeline\u002Freferences\u002Ftemplates\u002Fresearch_template.md",[129,138,147,156,162,168],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":32},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[135,136,137],"model","model hierarchy","model hierarchy skill",{"skillNo":139,"name":140,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":32},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[144,145,146],"MCP","zoom","zoom mcp",{"skillNo":148,"name":149,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":32},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[153,154,155,145],"sdk","zoom apps sdk","apps",{"skillNo":157,"name":158,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":32},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[158],{"skillNo":163,"name":164,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":32},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[164],{"skillNo":169,"name":170,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":32},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[170]]