[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTJRTKN6JC11DS303YTHGY":3,"skill-same:01M7CTJRTKN6JC11DS303YTHGY":55},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7CTJRTKN6JC11DS303YTHGY","redis-connections",null,"Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket timeouts. Use when configuring a Redis client (redis-py, Jedis, Lettuce, NRedisStack), batching commands for throughput, eliminating per-request connection creation, iterating large keyspaces with SCAN, enabling client-side caching for read-heavy workloads, or setting connect and read timeouts.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fredis-agent-skills\u002Fredis-connections\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: redis-connections\ndescription: Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket timeouts. Use when configuring a Redis client (redis-py, Jedis, Lettuce, NRedisStack), batching commands for throughput, eliminating per-request connection creation, iterating large keyspaces with SCAN, enabling client-side caching for read-heavy workloads, or setting connect and read timeouts.\nlicense: MIT\nmetadata:\n  author: Redis, Inc.\n  version: \"0.1.0\"\n---\n\n# Redis Connections\n\nClient-side guidance for talking to Redis efficiently: how to share connections, how to batch commands, which commands not to call in production, when to turn on client-side caching, and how to set timeouts that fail fast without breaking healthy traffic.\n\n## When to apply\n\n- Creating or reviewing a Redis client setup (redis-py, Jedis, Lettuce, go-redis, NRedisStack).\n- Making many small Redis calls and wondering where the latency is going.\n- Iterating large keyspaces, sets, hashes, or lists.\n- Enabling client-side caching for hot keys.\n- Tuning connect \u002F read \u002F write timeouts.\n\n## 1. Pool or multiplex — never one connection per request\n\nThe single biggest mistake in Redis client code is opening a new TCP connection for every operation. Always either:\n\n- **Pool** — keep N persistent connections that the application leases per call (redis-py `ConnectionPool`, Jedis `JedisPooled`, go-redis client).\n- **Multiplex** — share a single connection across all requests (Lettuce, NRedisStack).\n\n| Style | Used by | Note |\n|---|---|---|\n| Pool | redis-py, Jedis, go-redis | Each lease blocks if pool exhausted; size the pool to your concurrency |\n| Multiplex | Lettuce, NRedisStack | Single connection; **cannot** carry blocking commands like `BLPOP` |\n\n```python\n# redis-py — connection pool\npool = redis.ConnectionPool(host=\"localhost\", port=6379, max_connections=50)\nr = redis.Redis(connection_pool=pool)\n```\n\nSee [references\u002Fpooling.md](references\u002Fpooling.md) for Python + Java + Lettuce examples.\n\n## 2. Pipeline bulk work\n\nFor N commands that don't depend on each other's results, send them as a single batch with pipelining. One round-trip instead of N.\n\n```python\npipe = redis.pipeline()\nfor user_id in user_ids:\n    pipe.get(f\"user:{user_id}\")\nresults = pipe.execute()\n```\n\nUse **non-transactional** pipelining for performance, and `pipeline(transaction=True)` only when you actually need atomicity (see redis-core's transactions guidance).\n\nSee [references\u002Fpipelining.md](references\u002Fpipelining.md).\n\n## 3. Avoid commands that scan everything\n\nAnything that walks the whole keyspace (or a whole large container) blocks the server. Use incremental variants instead.\n\n| Don't | Use |\n|---|---|\n| `KEYS pattern` | `SCAN` cursor loop |\n| `SMEMBERS large_set` | `SSCAN` |\n| `HGETALL large_hash` | `HSCAN` |\n| `LRANGE 0 -1` on a huge list | Paginate (`LRANGE 0 100`) |\n\n```python\ncursor = 0\nwhile True:\n    cursor, keys = redis.scan(cursor, match=\"user:*\", count=100)\n    for key in keys:\n        process(key)\n    if cursor == 0:\n        break\n```\n\n**Blocking commands (`BLPOP`, `BRPOP`, `BLMOVE`) are different** — they intentionally wait for data and are fine for queue consumers, but always pass a timeout, and don't issue them on a multiplexed connection (Lettuce, NRedisStack).\n\nSee [references\u002Fblocking.md](references\u002Fblocking.md).\n\n## 4. Client-side caching for hot keys\n\nFor data that's read often and written rarely (config, feature flags, sessions on every request), enable RESP3 client-side caching. The client keeps a local copy and the server invalidates it on writes — saving the round trip for hot reads.\n\n```python\nclient = redis.Redis(\n    host=\"localhost\",\n    port=6379,\n    protocol=3,                                    # RESP3 is required\n    cache_config=redis.CacheConfig(max_size=1000),\n)\n```\n\nSkip it for write-heavy workloads or data that changes constantly — the invalidation traffic overruns the savings.\n\nSee [references\u002Fclient-cache.md](references\u002Fclient-cache.md).\n\n## 5. Set explicit timeouts\n\nDefaults vary by client and may be too generous. Pick values that match the *application's* failure model:\n\n```python\nr = redis.Redis(\n    host=\"localhost\",\n    socket_connect_timeout=2.0,   # fail fast on dead nodes\n    socket_timeout=5.0,           # tune to expected operation time\n    retry_on_timeout=True,\n)\n```\n\nRule of thumb: connect timeout shorter than read\u002Fwrite timeout. Tight timeouts + retry-on-timeout for latency-sensitive paths; longer timeouts for batch jobs.\n\nSee [references\u002Ftimeouts.md](references\u002Ftimeouts.md).\n\n## References\n\n- [Redis: Connection Pools and Multiplexing](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fpools-and-muxing\u002F)\n- [Redis: Pipelining](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fuse\u002Fpipelining\u002F)\n- [Redis: SCAN](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fcommands\u002Fscan\u002F)\n- [Redis: Client-side caching](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fclient-side-caching\u002F)\n- [Redis: Clients](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002F)\n","# Redis Connections\n\nClient-side guidance for talking to Redis efficiently: how to share connections, how to batch commands, which commands not to call in production, when to turn on client-side caching, and how to set timeouts that fail fast without breaking healthy traffic.\n\n## When to apply\n\n- Creating or reviewing a Redis client setup (redis-py, Jedis, Lettuce, go-redis, NRedisStack).\n- Making many small Redis calls and wondering where the latency is going.\n- Iterating large keyspaces, sets, hashes, or lists.\n- Enabling client-side caching for hot keys.\n- Tuning connect \u002F read \u002F write timeouts.\n\n## 1. Pool or multiplex — never one connection per request\n\nThe single biggest mistake in Redis client code is opening a new TCP connection for every operation. Always either:\n\n- **Pool** — keep N persistent connections that the application leases per call (redis-py `ConnectionPool`, Jedis `JedisPooled`, go-redis client).\n- **Multiplex** — share a single connection across all requests (Lettuce, NRedisStack).\n\n| Style | Used by | Note |\n|---|---|---|\n| Pool | redis-py, Jedis, go-redis | Each lease blocks if pool exhausted; size the pool to your concurrency |\n| Multiplex | Lettuce, NRedisStack | Single connection; **cannot** carry blocking commands like `BLPOP` |\n\n```python\n# redis-py — connection pool\npool = redis.ConnectionPool(host=\"localhost\", port=6379, max_connections=50)\nr = redis.Redis(connection_pool=pool)\n```\n\nSee [references\u002Fpooling.md](references\u002Fpooling.md) for Python + Java + Lettuce examples.\n\n## 2. Pipeline bulk work\n\nFor N commands that don't depend on each other's results, send them as a single batch with pipelining. One round-trip instead of N.\n\n```python\npipe = redis.pipeline()\nfor user_id in user_ids:\n    pipe.get(f\"user:{user_id}\")\nresults = pipe.execute()\n```\n\nUse **non-transactional** pipelining for performance, and `pipeline(transaction=True)` only when you actually need atomicity (see redis-core's transactions guidance).\n\nSee [references\u002Fpipelining.md](references\u002Fpipelining.md).\n\n## 3. Avoid commands that scan everything\n\nAnything that walks the whole keyspace (or a whole large container) blocks the server. Use incremental variants instead.\n\n| Don't | Use |\n|---|---|\n| `KEYS pattern` | `SCAN` cursor loop |\n| `SMEMBERS large_set` | `SSCAN` |\n| `HGETALL large_hash` | `HSCAN` |\n| `LRANGE 0 -1` on a huge list | Paginate (`LRANGE 0 100`) |\n\n```python\ncursor = 0\nwhile True:\n    cursor, keys = redis.scan(cursor, match=\"user:*\", count=100)\n    for key in keys:\n        process(key)\n    if cursor == 0:\n        break\n```\n\n**Blocking commands (`BLPOP`, `BRPOP`, `BLMOVE`) are different** — they intentionally wait for data and are fine for queue consumers, but always pass a timeout, and don't issue them on a multiplexed connection (Lettuce, NRedisStack).\n\nSee [references\u002Fblocking.md](references\u002Fblocking.md).\n\n## 4. Client-side caching for hot keys\n\nFor data that's read often and written rarely (config, feature flags, sessions on every request), enable RESP3 client-side caching. The client keeps a local copy and the server invalidates it on writes — saving the round trip for hot reads.\n\n```python\nclient = redis.Redis(\n    host=\"localhost\",\n    port=6379,\n    protocol=3,                                    # RESP3 is required\n    cache_config=redis.CacheConfig(max_size=1000),\n)\n```\n\nSkip it for write-heavy workloads or data that changes constantly — the invalidation traffic overruns the savings.\n\nSee [references\u002Fclient-cache.md](references\u002Fclient-cache.md).\n\n## 5. Set explicit timeouts\n\nDefaults vary by client and may be too generous. Pick values that match the *application's* failure model:\n\n```python\nr = redis.Redis(\n    host=\"localhost\",\n    socket_connect_timeout=2.0,   # fail fast on dead nodes\n    socket_timeout=5.0,           # tune to expected operation time\n    retry_on_timeout=True,\n)\n```\n\nRule of thumb: connect timeout shorter than read\u002Fwrite timeout. Tight timeouts + retry-on-timeout for latency-sensitive paths; longer timeouts for batch jobs.\n\nSee [references\u002Ftimeouts.md](references\u002Ftimeouts.md).\n\n## References\n\n- [Redis: Connection Pools and Multiplexing](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fpools-and-muxing\u002F)\n- [Redis: Pipelining](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fuse\u002Fpipelining\u002F)\n- [Redis: SCAN](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fcommands\u002Fscan\u002F)\n- [Redis: Client-side caching](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fclient-side-caching\u002F)\n- [Redis: Clients](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002F)\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"Redis, Inc.","0.1.0","main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fredis-agent-skills\u002Fredis-connections",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill redis-connections",{"tool":41,"command":42},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill redis-connections",{"tool":44,"command":45},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill redis-connections","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fredis-agent-skills\u002Fredis-connections\u002FSkill.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"metadata.json","REFERENCE","参考文档",442,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fredis-agent-skills\u002Fredis-connections\u002Fmetadata.json",[56,63,68,75,80,87],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":64,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":76,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":88,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]