{"id":22492,"date":"2026-11-24T13:00:00","date_gmt":"2026-11-24T12:00:00","guid":{"rendered":"https:\/\/webhosting.de\/?p=22492"},"modified":"2026-11-17T00:00:54","modified_gmt":"2026-11-16T23:00:54","slug":"redis-client-side-caching","status":"publish","type":"post","link":"https:\/\/webhosting.de\/en\/redis-client-side-caching\/","title":{"rendered":"Redis Client-Side Caching: Targeted Reduction of Network Traffic and Latency"},"content":{"rendered":"<div class=\"wh-article\" data-wh-layout=\"2.1.2\" style=\"width:100%;max-width:820px;margin:0 auto;color:#263b4b;font-family:inherit;font-size:18px;line-height:1.8;text-align:start;overflow-wrap:break-word;box-sizing:border-box\"><p class=\"wh-lead\" style=\"font-size:20px;line-height:1.7;color:#233746;margin:0 0 1.1em\">Redis client-side caching stores suitable read results directly in the application process. A <strong style=\"font-weight:700;color:inherit\">local match<\/strong> Avoids the Redis read operation and its network traffic. Redis Tracking notifies the client of changes so that it can remove affected entries. Data that is read very frequently but rarely changed is particularly suitable for this. Whether the application becomes faster overall depends, among other things, on the hit rate, write load, and memory requirements. Furthermore, invalidations do not guarantee that concurrent accesses will always see a globally up-to-date value.  <\/p>\n<nav class=\"wh-toc\" aria-label=\"Contents of this article\" style=\"display:block;margin:28px 0 38px;padding:22px;border:1px solid #d9e4e8;border-radius:14px;background:#f4f8f8\"><p class=\"wh-toc-title\" style=\"font-size:13px;font-weight:700;letter-spacing:.08em;color:#49656b;margin:0 0 14px\">Go directly to the section<\/p><div class=\"wh-toc-grid\" style=\"display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:10px\"><div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#grundlagen-ablauf\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Local Hits and Redis Accesses<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#tracking-konsistenz\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Tracking and the Limits of Timeliness<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#voraussetzungen-versionen\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Products, Protocols, and Client Versions<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#protokollbeispiel\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Understanding Invalidation in the Test<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#tracking-varianten\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Select Tracking Modes as Needed<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#einsatzmuster-vergleich\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">What data benefits from caching?<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#verbindungen-fehler\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Connection Loss and Race Conditions<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#betrieb-messung\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Limit the Cache and Measure the Impact<\/a><\/div>\n<div class=\"wh-toc-item\" style=\"display:block;min-width:0;margin:0;padding:0\"><a class=\"wh-toc-link\" href=\"#entscheidung-fehlersuche\" style=\"display:block;height:100%;padding:12px 15px;border:1px solid #dce6e8;border-radius:9px;background:#fff;color:#18575b;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;box-sizing:border-box\">Troubleshooting and Decision to Implement<\/a><\/div>\n<\/div><\/nav><section class=\"wh-section\" aria-labelledby=\"grundlagen-ablauf\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"grundlagen-ablauf\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Local Hits and Redis Accesses<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A product catalog reads item information from Redis every time it is accessed. The first time a valid key is accessed, the result is not yet in the local cache: The application queries Redis and can store the response in its process\u2019s memory. This first access is a <strong style=\"font-weight:700;color:inherit\">Cache Miss<\/strong>. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If the same process requests the value again and the entry is still valid, the response comes from local storage. This match avoids the Redis read operation and the associated network traffic. Especially for frequently read, rarely updated product data, this can reduce the number of requests to Redis and save time. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If another service modifies the item in Redis, Redis can notify the client of the affected key name. The client removes the local entry; the next time it reads the item, a miss occurs again, and the value is reloaded from Redis. The invalidation itself is not an updated product response. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">The <strong style=\"font-weight:700;color:inherit\">Process memory<\/strong> It is not the same as the central Redis store. Multiple application instances can each have their own local entries and must keep their caches up to date independently. If a request is routed to another instance, it may initially trigger a miss there, even though the value is already stored locally elsewhere. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A local hit does not automatically make the entire service faster: the hit rate, write load, network path, and memory usage also influence the result. Redis itself can also serve as a central cache layer, for example when <a href=\"https:\/\/webhosting.de\/en\/configure-caching-wordpress-redis-speed-up-performance-9324\/\">Caching for WordPress with Redis<\/a>. Client-side caching extends this layer by adding storage directly within the application. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"tracking-konsistenz\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"tracking-konsistenz\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Tracking and the Limits of Timeliness<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">To prevent local entries from becoming permanently outdated without being noticed, Redis uses server-side <strong style=\"font-weight:700;color:inherit\">Tracking<\/strong>. In normal mode, the server keeps track of which keys a connection has requested via read operations. This process is not limited to simple GET requests: other read-only commands can also affect tracked keys. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If a tracked key is modified, expires, or is evicted by Redis due to a storage policy, the server sends an invalidation. The client must then remove the affected local results. Only a subsequent read operation will load an up-to-date value, if applicable; the notification does not automatically include this value. <\/p>\n<figure class=\"wp-block-image size-large wh-figure\" aria-describedby=\"wh-caption-detail1\" style=\"display:block;float:none;clear:both;width:100%;max-width:760px;margin:34px auto 40px;border:1px solid #dae5e9;border-radius:14px;overflow:hidden;background:#f5f8fa;box-shadow:0 10px 28px -17px rgba(24,47,60,.28);box-sizing:border-box\"><div class=\"wh-figure-media\" style=\"display:block;background:#eef3f5;line-height:0\"><img loading=\"lazy\" width=\"800\" height=\"534\" src=\"https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5-1024x683.webp\" class=\"wp-image-22495\" alt=\"AI-generated illustration of a tile removed from its local storage compartment, symbolizing invalidation\" decoding=\"async\" srcset=\"https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5-1024x683.webp 1024w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5-300x200.webp 300w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5-768x512.webp 768w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5-18x12.webp 18w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-tracking-invalidierung-65c81f2e-detail1-f51c8b0ce5.webp 1536w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" ><\/div><figcaption class=\"wh-caption\" id=\"wh-caption-detail1\" style=\"display:block;margin:0;padding:12px 18px 15px;border-top:1px solid #dce5e9;color:#506575;background:#f5f8fa;font-size:14px;line-height:1.55;text-align:start\">AI-generated illustration: An invalidation removes the local entry instead of automatically providing a new value.<\/figcaption><\/figure><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">This process does not provide a blanket guarantee that responses will always be globally up-to-date. Between the time a change occurs, the message is delivered, and it is processed, concurrent access may occur. For profiles or other data with strict timeliness requirements, you should therefore verify the level of consistency actually provided by the specific client implementation and the overall architecture. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Redis limits the overhead of its tracking table. If a tracked entry needs to be removed from it, the server may invalidate it as a precaution, even though the stored value has not changed. This ensures the correctness of the process but may result in an additional miss and a repeat read operation. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Even keys with the same name in different logical databases can cause unexpected invalidations: The tracking table does not distinguish between key names based on the database. A change in one database can therefore invalidate a local entry with the same name in another database, even though its value has not been changed. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"voraussetzungen-versionen\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"voraussetzungen-versionen\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Products, Protocols, and Client Versions<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Before implementation, you must consider the server product, database version, protocol, and client library separately. Redis Open Source supports server-side tracking starting with version 6. Redis Software and Redis Cloud have their own compatibility limitations; in particular, the redirection of invalidations via <code data-no-translation style=\"font:600 .87em\/1.5 ui-monospace,monospace;color:#235063;background:#edf3f5;border-radius:4px;padding:.1em .3em\">REDIRECT<\/code> Not available. <\/p>\n<div class=\"wh-table-scroll\" tabindex=\"0\" role=\"region\" aria-label=\"Product and Protocol Limits for Server-Side Tracking\" style=\"width:100%;max-width:100%;overflow-x:auto;margin:28px 0;border:1px solid #dce5e9;border-radius:14px;background:#fff;box-shadow:0 10px 28px -16px rgba(24,47,60,.32);box-sizing:border-box\"><table style=\"width:100%;min-width:580px;border-collapse:separate;border-spacing:0;border:0;margin:0;font-size:15px;line-height:1.6;background:#fff\"><caption style=\"padding:20px;text-align:start;font-size:17px;line-height:1.5;font-weight:700;color:#173246;background:#fff\">Product and Protocol Limits for Server-Side Tracking<\/caption><thead><tr><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Product<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Minimum version<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Protocol<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">REDIRECT<\/th><\/tr><\/thead><tbody><tr><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Redis Open Source<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Redis 6<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">RESP2 or RESP3<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Supported<\/td><\/tr><tr><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Redis Software and Redis Cloud<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Redis database version 7.4<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">RESP3<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Not supported<\/td><\/tr><\/tbody><\/table><\/div><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">The server function alone does not yet provide a finished <strong style=\"font-weight:700;color:inherit\">local cache<\/strong>. The library must store results, handle invalidations, and manage the cache appropriately in the event of connection issues. Therefore, check which features and configuration options are available for the client version actually in use. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">The Redis introduction lists the following minimum versions for client-side caching: redis-py 5.1.0, Jedis 5.2.0, node-redis 5.1.0, and go-redis 9.22.0. These version numbers do not mean that all libraries support the same operating modes or the same selection of individual keys. The documentation for the selected version is authoritative. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">According to the connection-specific documentation for go-redis, the function is <strong style=\"font-weight:700;color:inherit\">experimental<\/strong>. That document lists RESP3, standalone clients, and logical database 0 as prerequisites or limitations. Therefore, an existing Redis server with tracking support is not sufficient to determine its suitability for every go-redis setup. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"protokollbeispiel\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"protokollbeispiel\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Understanding Invalidation in the Test<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Using two connections, you can observe how Redis notifies you of a change to a key that was previously read. To do this, use an isolated test environment and a key created specifically for this purpose: The write command modifies data. This example is schematic and illustrates the protocol principle; it is not a complete client implementation. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">First, specify the Redis client, its version, and the RESP mode. For this process, Connection A must support RESP3 and the processing of push messages; check the documentation for the selected client to see how it makes these messages visible. A normal command response alone does not indicate whether the invalidation was received and processed. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Execute the following commands in the order shown. The labels A and B refer to two separate connections and are not part of the respective command. The first line enables tracking on A; B writes only after A has read the key.<\/p>\n<div class=\"wh-code-window\" data-wh-code style=\"margin:28px 0 34px;border:1px solid #2c4656;border-radius:12px;overflow:hidden;background:#132a3b;box-shadow:0 9px 25px -13px rgba(15,35,55,.2)\"><div class=\"wh-code-toolbar\" style=\"display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:11px 16px;background:#223e50;color:#edf5fa;font-size:13px;line-height:1.5;font-weight:600\"><span>Code<\/span><button type=\"button\" class=\"wh-code-copy\" data-wh-copy hidden style=\"padding:6px 11px;border:1px solid #7893a1;border-radius:6px;background:transparent;color:#fff;font-size:12px;line-height:1.5;font-weight:600;cursor:pointer\">Copy code<\/button><span class=\"wh-copy-status\" aria-live=\"polite\"><\/span><span data-wh-copy-success hidden>Copied<\/span><span data-wh-copy-fallback hidden>Code highlighted\u2014please copy<\/span><\/div><pre class=\"wh-code\" data-no-translation translate=\"no\" style=\"display:block;margin:0;padding:20px;max-width:100%;overflow-x:auto;color:#edf5fa;background:#132a3b;font:14px\/1.75 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre;direction:ltr;text-align:left\"><code class=\"language-text\" style=\"font:inherit;color:inherit;background:transparent;padding:0;border:0;white-space:inherit\">Verbindung A: CLIENT TRACKING ON\nVerbindung A: GET beispiel:profil\nVerbindung B: SET beispiel:profil neuer-wert<\/code><\/pre><\/div><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">After the read operation, Redis tracks the key for connection A. If B changes the value, Redis sends a <strong style=\"font-weight:700;color:inherit\">Invalidation<\/strong> To A. Its display depends on the client; it does not automatically include the new value. A true cache would have to remove the affected local entry and read it again if necessary. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">This example does not store any read results locally and does not handle connection failures or concurrent access. It is therefore intended to help you understand the sequence of messages, not as a template for a production-ready cache. Test for such error cases using the library you are actually using and its connection configuration. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"tracking-varianten\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"tracking-varianten\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Select Tracking Modes as Needed<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Redis offers various ways to define the scope of data being tracked. This choice affects how much state the server manages and how many invalidation requests are sent to the client. It is a protocol decision: You must determine separately whether and how a library makes the respective options available to its local cache. <\/p>\n<div class=\"wh-table-scroll\" tabindex=\"0\" role=\"region\" aria-label=\"Tracking Methods and Their Effects\" style=\"width:100%;max-width:100%;overflow-x:auto;margin:28px 0;border:1px solid #dce5e9;border-radius:14px;background:#fff;box-shadow:0 10px 28px -16px rgba(24,47,60,.32);box-sizing:border-box\"><table style=\"width:100%;min-width:580px;border-collapse:separate;border-spacing:0;border:0;margin:0;font-size:15px;line-height:1.6;background:#fff\"><caption style=\"padding:20px;text-align:start;font-size:17px;line-height:1.5;font-weight:700;color:#173246;background:#fff\">Tracking Methods and Their Effects<\/caption><thead><tr><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Variant<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Server costs<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">News Consumption Behavior<\/th><th scope=\"col\" style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#19394d;color:#fff\">Scope of Application<\/th><\/tr><\/thead><tbody><tr><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Normal<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Manages tracked keys and associated clients.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Invalidates tracked keys when relevant changes are made.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Should read operations on keys be tracked by default?<\/td><\/tr><tr><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">OPTIN<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Tracks only explicitly selected read operations.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Invalidations apply to the selected keys.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#f4f7f9;color:#294252\">Is it possible to specifically mark appropriate read operations?<\/td><\/tr><tr><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Broadcasting<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">There is no tracking table for each key read in this mode.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Invalidated based on subscribed prefixes, even for keys that are not stored locally.<\/td><td style=\"padding:15px 18px;border:0;border-bottom:1px solid #e2e9ed;text-align:start;vertical-align:top;white-space:normal;font-size:15px;line-height:1.6;background:#fff;color:#294252\">Do the prefixes sufficiently narrow down the data of interest?<\/td><\/tr><\/tbody><\/table><\/div><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">In normal mode, Redis can also track keys whose results the application does not store locally at all. <strong style=\"font-weight:700;color:inherit\">OPTIN<\/strong> limits tracking to selected read operations. When OPTIN is enabled, it marks <code data-no-translation style=\"font:600 .87em\/1.5 ui-monospace,monospace;color:#235063;background:#edf3f5;border-radius:4px;padding:.1em .3em\">CLIENT CACHING YES<\/code> Generally, the command that immediately follows; documented special rules apply to transactions and scripts. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">At <strong style=\"font-weight:700;color:inherit\">Broadcasting<\/strong> Instead, you subscribe to key prefixes. In this mode, Redis does not need to keep every key it reads in a tracking table. However, a change can trigger notifications to clients that have never cached the key in question. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A broad prefix includes more keys and can generate a correspondingly higher number of messages when many changes are made. Narrower prefixes are only helpful if they match the actual access pattern and cover all the necessary keys. Therefore, do not compare only the server overhead, but also the message volume and the overhead for client processing. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"einsatzmuster-vergleich\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"einsatzmuster-vergleich\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">What data benefits from caching?<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A product catalog with frequently accessed and rarely modified entries is an obvious candidate. Repeated accesses can be handled locally, while changes invalidate the affected entries. However, how often the same process needs to retrieve an entry again also depends on how requests are distributed across the application instances. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Repeated read operations are also of interest when it comes to user profiles. However, the key factor is the <strong style=\"font-weight:700;color:inherit\">Timeliness Requirement<\/strong>: If another service modifies a profile, concurrent requests may still see an older value before the update is processed. The product team must decide whether a briefly outdated display is acceptable for the specific use case. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Counters and rankings, on the other hand, change frequently. Frequent invalidations and subsequent read operations can negate the benefits of local hits. For such data, a separate connection without client-side caching may be useful, while another connection continues to cache appropriate, more stable values. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Many keys that are rarely accessed again are also problematic: they take up local memory without yielding frequent hits. A limited cache size protects the memory budget, but does not resolve the question of which data is actually worth storing. Selective tracking or direct Redis accesses may be the better choice for such access patterns. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">As an alternative, reduce <strong style=\"font-weight:700;color:inherit\">pipelining<\/strong> the overhead of network round trips by bundling multiple commands. The commands still reach Redis; however, a local cache hit avoids the corresponding read operation. Both methods solve different problems and can also be combined depending on the access pattern. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A conventional local cache with a limited lifetime is another option. However, without reliable invalidation, the application must accept that a modified value may remain out of date until the local TTL expires. Direct accesses bypass this local state and serve as a particularly good benchmark when hits are rare or consistency requirements are high. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"verbindungen-fehler\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"verbindungen-fehler\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Connection Loss and Race Conditions<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">With RESP3, Redis can send read responses and invalidations to the client over the same connection. Redis Open Source alternatively supports redirecting invalidations to a second connection; with RESP2, this two-connection model is required. Redis Software and Redis Cloud support RESP3 for client-side caching, but do not support redirection via REDIRECT.  <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Two connections require special care when <strong style=\"font-weight:700;color:inherit\">News Order<\/strong>: One application reads a key while another client is modifying it. The invalidation may arrive via the second connection before the older read response from the first connection has been processed. If the client were to store this response afterward without checking it, a value that is already invalid could remain in the cache. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">The Redis documentation describes a placeholder approach: The client marks the pending read operation in the cache in advance. When an invalidation occurs, it removes this placeholder; the response that arrives later must not simply be stored as a valid entry. For a single connection, the order of the messages is known, which simplifies this mapping. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If the connection for invalidations is lost, the client may miss changes. Therefore, treat the local cache as untrusted and clear it before using it again as usual. Reconnecting alone does not retroactively update previously stored values; any required data must be reloaded afterward.  <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">For the selected library and version, check how it handles connection breaks, reconnections, and connection pools. The Redis introduction also describes how its clients clear the cache when a connection is lost within a pool. Whether and when this occurs in your specific implementation is one of the conditions for secure operation. <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"betrieb-messung\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"betrieb-messung\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Limit the Cache and Measure the Impact<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Place a <strong style=\"font-weight:700;color:inherit\">Memory Limit<\/strong> for the local cache. It's not just a process's memory usage that matters: If the application is running in multiple instances, each instance may have its own cache. Therefore, plan the budget per instance and keep in mind that the same frequently used values may be stored multiple times in memory.  <\/p>\n<figure class=\"wp-block-image size-large wh-figure\" aria-describedby=\"wh-caption-detail2\" style=\"display:block;float:none;clear:both;width:100%;max-width:760px;margin:34px auto 40px;border:1px solid #dae5e9;border-radius:14px;overflow:hidden;background:#f5f8fa;box-shadow:0 10px 28px -17px rgba(24,47,60,.28);box-sizing:border-box\"><div class=\"wh-figure-media\" style=\"display:block;background:#eef3f5;line-height:0\"><img loading=\"lazy\" width=\"800\" height=\"534\" src=\"https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0-1024x683.webp\" class=\"wp-image-22496\" alt=\"AI-generated stock image of several memory modules on an antistatic mat\" decoding=\"async\" srcset=\"https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0-1024x683.webp 1024w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0-300x200.webp 300w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0-768x512.webp 768w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0-18x12.webp 18w, https:\/\/webhosting.de\/wp-content\/uploads\/2026\/11\/redis-cache-speicherbudget-65c81f2e-detail2-2b70b86da0.webp 1536w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" ><\/div><figcaption class=\"wh-caption\" id=\"wh-caption-detail2\" style=\"display:block;margin:0;padding:12px 18px 15px;border-top:1px solid #dce5e9;color:#506575;background:#f5f8fa;font-size:14px;line-height:1.55;text-align:start\">AI-generated illustrative image: Local caches require their own memory for each application instance.<\/figcaption><\/figure><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">A local maximum TTL can also limit how long an entry is used without being reloaded. It should not be confused with the key's expiration time on the Redis server and does not replace proper invalidation. If a value is changed shortly after being stored locally and the notification is missed, it may otherwise remain out of date until the local expiration time. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">For a meaningful comparison, load the same application once with client-side caching and once without it. Use a representative load and keep the environment and configuration as consistent as possible. In particular, document the warm-up phase, the distribution of keys, the proportion of write operations, and the number of instances; otherwise, it will be difficult to attribute differences to the cache.<\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Track local hits and misses, along with invalidations and Redis requests. Track network traffic and memory usage per instance. A high hit rate is helpful, but it doesn't fully explain whether the additional memory and the processing of invalidations make sense for your service overall. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Also, consider the <strong style=\"font-weight:700;color:inherit\">Latency Distribution<\/strong> of the application rather than just an average value. For example, compare how typical and slower requests behave during and after the warm-up phase. While a local hit avoids the Redis read operation, only measurements under an appropriate load will show whether this reduces the response time of the entire service.  <\/p>\n<\/section><section class=\"wh-section\" aria-labelledby=\"entscheidung-fehlersuche\" style=\"display:block;margin:0 0 36px;min-width:0\"><h2 id=\"entscheidung-fehlersuche\" style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Troubleshooting and Decision to Implement<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If the hit rate is low, start by asking whether the same keys are ever read repeatedly within a single instance. A wide key distribution, frequent eviction, or many short-lived instances can prevent the cache from warming up sufficiently. At the same time, check whether the available memory is sufficient for the data that actually recurs. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Many <strong style=\"font-weight:700;color:inherit\">Invalidations<\/strong> Note that values are often changed, or the client may receive messages that are of little use to it. Compare the change rate with the number of read operations and check the selected tracking mode. For data that changes frequently, a separate connection without a local cache may be more appropriate.  <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">If the cache grows more than expected, investigate the cache limit and usage across all instances. If you encounter unexpectedly old data, however, first check how invalidations are handled and how the system behaves when a connection is lost or reestablished. A local TTL can limit the duration of an error, but it does not explain its cause.  <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">For profiles and sessions, the <strong style=\"font-weight:700;color:inherit\">Consistency Requirement<\/strong> A product decision of your own: Determine whether a temporarily outdated display or decision is acceptable and which other services modify the same data. The use of <a href=\"https:\/\/webhosting.de\/en\/redis-session-php-applications-technology\/\">Redis as Session Storage for PHP Applications<\/a> describes a central storage system; however, this does not guarantee that additional local caches are up to date. <\/p>\n<p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Implement caching primarily for data that is read frequently but rarely changed, provided that memory constraints, client behavior, and freshness requirements align. Selective use separates such values from write-intensive data. Avoid using caching if the measured benefit does not justify the effort or if the application cannot accept the potential consistency limitations. <\/p>\n<\/section><section class=\"wh-sources\" style=\"margin:40px 0 0;padding:24px 0 0;border-top:1px solid #dce5e9;color:#596b7b;font-size:14px;line-height:1.65\"><h2 style=\"margin:38px 0 18px;color:#172f41;font-size:clamp(24px,1.25rem + 1vw,30px);font-weight:700;line-height:1.3;scroll-margin-top:115px\">Sources and Current State of Knowledge<\/h2><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Status of the research: <time datetime=\"2026-11-16\">2026-11-16<\/time><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\">Research and version status: November 16, 2026. Before implementation, verify product, protocol, and client support again using the documentation for the specific version being used.<\/p><div class=\"wh-source-urls\"><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/develop\/clients\/client-side-caching\/<\/span><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/develop\/reference\/client-side-caching\/<\/span><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/operate\/rs\/references\/compatibility\/client-side-caching\/<\/span><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/develop\/clients\/go\/connect\/<\/span><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/develop\/use\/client-side-caching\/<\/span><\/p><p style=\"margin:0 0 1.1em;font-size:inherit;line-height:inherit\"><span class=\"wh-source-url\" data-no-translation dir=\"ltr\" style=\"overflow-wrap:anywhere;font:12px\/1.6 ui-monospace,monospace;direction:ltr\">https:\/\/redis.io\/docs\/latest\/management\/optimization\/latency\/<\/span><\/p><\/div><\/section><\/div>","protected":false},"excerpt":{"rendered":"<p>Redis client-side caching stores eligible read results locally. Learn how tracking and invalidation work, what consistency limits apply, and how to measure its benefits.<\/p>","protected":false},"author":1,"featured_media":22494,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[781],"tags":[],"class_list":["post-22492","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-datenbanken-administration-anleitungen"],"acf":[],"_links":{"self":[{"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/posts\/22492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/comments?post=22492"}],"version-history":[{"count":2,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/posts\/22492\/revisions"}],"predecessor-version":[{"id":22497,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/posts\/22492\/revisions\/22497"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/media\/22494"}],"wp:attachment":[{"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/media?parent=22492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/categories?post=22492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhosting.de\/en\/wp-json\/wp\/v2\/tags?post=22492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}