ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial5 min readDisconfirmAI Editorial

Alibaba Cloud's AI Coding Assistant Qoder Nearly Doubles Tasks Per Quota Through Three Cache Optimization Strategies

Alibaba Cloud's AI coding assistant Qoder details how three caching optimizations—layered system prompts, two-level session affinity routing, and parent-child session inheritance—raised cache hit rates and reduced average Credits per Auto task from 4.43 to 2.6.

Verified 2026-11-24 18:47 GMT+8

Model caching matches the prefix of a request. A hit requires three conditions to hold at once: the content before the cache point must be identical word for word, the request must land on the same resource that stored the cache, and it must arrive within the cache's validity window. Any change anywhere in between forces everything after it to be reprocessed. Qoder made three optimizations along these conditions, each aimed at a different scenario. The result is a 41% drop in average Credits consumed per Auto task over the past month, from 4.43 to 2.6. At that average, a quota that previously covered 10 tasks now covers roughly 17.

The first strategy addresses prefix identity. In a single development task, an agent may send dozens of rounds of requests to the model. Each round carries tool definitions, the system prompt, and the entire conversation so far, yet what is actually new is usually just the latest tool result. Model caching says the repeated content does not need recomputation: if the input prefix matches content the model has already processed, that portion costs far less than reprocessing, potentially dropping to one-tenth or even one-twentieth of the uncached rate. The problem Qoder found was that on explicit-caching models such as Qwen and an overseas SOTA model, 5% of requests recorded zero cache hits. The cause was how the system prompt was organized: it contained both public rules shared by all users and personalized content that varies per user, all in a single block. A cache point could only be placed at the end of that whole block, so once the personalized content changed, the large fixed chunk ahead of it could not be reused independently.

The fix was to split the system prompt into ordered content blocks, placing the globally shared part first and the personalized part last, then positioning cache points at the boundary of each layer. After this change, a single request to the overseas SOTA model carries up to 4 cache points, ordered from widest to narrowest reuse scope: end of built-in tools, end of the globally shared prompt, end of the full system prompt, and end of the conversation. The earlier a layer, the more stable it is, and the more chances there are to reuse it. Only the common prefix containing no user information is reused across users; prefixes with personalized content and conversation history are reused only by the same user's subsequent requests.

Sign in / Sign up
ReadingResearchRadarInvestment framework

The second strategy addresses the other two conditions: whether the request lands on the same resource, and whether it arrives within the cache's validity period. Model cache is stored on the specific resource that created it. If the first round of a session lands on Resource A and builds a cache, but the second round just seconds later is scheduled to Resource B, the identical prefix cannot be found and everything must be recomputed. Qoder added a two-level session affinity layer ahead of default scheduling: model pool affinity keeps a session from switching models midway, while resource affinity keeps requests inside that pool on the resource used in the previous round. Both levels are necessary—switch the model and the cache cannot be reused; keep the model but switch the resource and the cache cannot be found. The validity period of an affinity record is aligned with the cache lifetime of the corresponding model, which differs across providers.

The third strategy extends caching beyond a single session boundary. When a user finishes discussing an implementation plan and opens a side task to add tests, or forks a branch to try a different approach, these new sessions have their own identifiers yet inherit the parent session's context. To the scheduling layer, it looks like a brand-new session, so it picks the model pool and resource again; from the input's perspective, the prefix has already been fully processed. Qoder includes the originating session identifier in the request and uses it to establish a parent-child relationship. A child session's first request directly follows the model pool and resource of the parent's last request, then writes its own affinity record and proceeds independently. Side tasks and forked sessions can now reuse the main session's cache.

The reference consumption multiplier for the Auto tier was updated from 0.5x to 0.3x to reflect the improved consumption level. Qoder notes this is not a limited-time discount but a real change that technical optimization has already delivered, and no manual configuration is required—users benefit automatically when using the Auto tier. The article also addresses a common question: the Auto tier is not backed by one specific model; routing picks the best fit from the pool based on task type, but cache affinity is applied so that the model is not switched while the cache is still valid, meaning dynamic model selection does not create extra cost.

What this explanation does not establish: the 41% figure is an aggregate average reported by Qoder for its own product, with no independent reproduction or breakdown by task complexity, model, or session length. The strategies depend on specific caching mechanisms each model provider implements, and the article notes that each model imposes its own limits on minimum cacheable length and number of cache points without detailing them. The actual billing follows the specific model a request is routed to, so the 0.3x multiplier is a reference estimate rather than a fixed charge.

Sources

  • alibabacloud.comAlibaba Cloud Community↗
Continue researching →