Skip to Content

Caching in Odoo: Where the Native Tools Stop

Odoo ships with several distinct caches. Understanding what each one actually does is the first step toward knowing when you need something more.
December 4, 2026 by
Caching in Odoo: Where the Native Tools Stop
Adessa Walker

Odoo has not one cache but several, and they are not interchangeable. The ORM (Object-Relational Mapping) cache, the registry cache, the asset bundle cache, and the ir.attachment URL cache each solve a different problem. When performance starts slipping, the instinct is often to reach for Redis or some other external caching layer. That instinct is sometimes right, but it usually comes too early. Before you add infrastructure, it helps to know what you already have and where it actually breaks down.

What the Native Caches Actually Do

The ORM Cache

The ORM cache lives at the request level. Within a single transaction, Odoo avoids redundant database reads by keeping a short-lived record cache in memory. If your code reads the same record twice in the same request, the second read comes from this cache, not from PostgreSQL. This is efficient for the common case: a user opens a form view, several computed fields fire, and the same partner or product record gets touched multiple times along the way.

The important thing to understand is that this cache does not survive the request. It is scoped to the current environment object, and it is thrown away when the transaction ends. It also does not help you across workers. If you have four Odoo worker processes running, each one has its own ORM cache with no awareness of what the others have loaded. That is the first boundary where the native tooling stops being enough.

The Registry Cache

The registry cache is longer-lived. Odoo builds a model registry when the server starts, and it holds the full Python class structure for every model in your database: field definitions, method resolution order, inherited fields, everything. This cache is shared across workers via a signaling mechanism that uses the database itself. When you install or upgrade a module, the registry is invalidated and rebuilt.

You do not interact with the registry cache directly in normal usage. Its performance implications show up mostly during startup and after upgrades. Where it matters for a performance conversation is this: if your system carries a very large number of custom fields or has deeply layered module inheritance, registry builds get noticeably slower. That is rarely the first place to look for a performance problem, but it is worth knowing the registry exists as a distinct layer.

The Asset Bundle Cache

Every time Odoo serves JavaScript, CSS, and related frontend assets, it compiles and minifies them into asset bundles. These are stored as ir.attachment records and served with a URL that includes a checksum. The checksum changes when the underlying assets change, which gives you automatic cache-busting. A CDN (Content Delivery Network) or browser cache can hold these bundle URLs for a long time without worrying about serving stale files, because a changed asset gets a new URL.

Where this breaks down is during active development or in environments where assets are being changed frequently. Odoo does provide a developer mode flag that bypasses bundle caching, but in production that flag should not be on. If you are seeing stale frontend behavior, the usual fix is to clear assets from the Settings menu, not to redesign the cache layer.

The ir.attachment URL Cache

Static files served through Odoo, things like image attachments and downloadable documents, also carry URL-level caching headers. Odoo sets these headers based on the attachment's write date. The practical implication is that if you replace an attachment without changing its record, browsers and CDNs may continue to serve the old version. This is a common source of confusion when updating product images in the website shop: the file changes, but the old image is still in cache. The fix is usually to force a new attachment record rather than updating the existing one, or to configure your CDN to respect shorter cache durations for attachment URLs.

When You Outgrow the Native Tools

The native caches handle the common cases well. Where they stop being enough is predictable, and it usually shows up in one of three patterns.

High-Cardinality Computed Fields

Computed fields that aggregate across many records are expensive. Odoo can store them (using the store=True flag on the field definition), which moves the computation to write time instead of read time, but that only helps if writes are infrequent relative to reads. If you have a computed field that touches thousands of stock move records every time a sale order is confirmed, storing it does not eliminate the cost; it just moves when the cost lands. And if the underlying records change often, Odoo may recompute more frequently than you expect because its dependency tracking is conservative by design.

This is the first place where teams start asking whether a custom caching layer would help. Sometimes the right answer is a stored field with a more selective invalidation trigger. Sometimes it is a summary table maintained by a scheduled action. The point is that the native ORM cache was never designed for this problem.

Page Render Bottlenecks

Odoo's website module renders pages by assembling QWeb (Odoo's XML-based templating engine) templates, evaluating expressions, and pulling data from the database. For pages that show the same content to many different visitors, like a public product catalog, this is a lot of repeated work. Odoo has some built-in view caching, but it is fairly coarse. A busy e-commerce site will eventually find that the database is doing more work per page request than it needs to.

This is where CDN-level caching becomes worth the conversation. Pages that are truly public and truly static between updates can be cached at the CDN layer. The hard part is not enabling the cache; it is deciding which pages qualify and what event should invalidate them. A product page that changes when inventory drops to zero is not a great candidate for a long CDN cache lifetime without a careful invalidation strategy.

Cross-Worker Data That Changes Slowly

Some data is read constantly but changes rarely: configuration values, pricelist rules, currency rates, permission matrices. Each Odoo worker loads this independently on demand. If you have ten workers and each one is hitting the database for the same configuration record dozens of times per minute, you have a case for something longer-lived than the ORM cache and more targeted than the registry.

This is where in-memory caching with an explicit invalidation hook becomes relevant. The idea is simple: load the value once per worker, store it in a module-level Python dictionary, and clear that dictionary when the underlying record is written. Odoo's override of the write and unlink methods gives you the hook. The risk is that you have now taken responsibility for invalidation correctness, and that responsibility is easy to underestimate.

The Decision Tree for Custom Caching

When a native cache is not enough, there are roughly three directions to consider. None of them is universally right.

PostgreSQL-backed cache table. A dedicated table that stores precomputed results alongside a timestamp or version key. A scheduled action or a write-time trigger populates it. Queries read from the cache table instead of computing on the fly. This approach is transparent, debuggable, and survives a server restart. The downside is that it adds a maintenance surface: the scheduled action needs to run on the right cadence, and if it falls behind, your cache is stale.

In-memory cache with invalidation hooks. Module-level Python caching, typically a dictionary or a lightweight structure decorated with an LRU (Least Recently Used) eviction policy, cleared by overriding write and unlink on the relevant model. This is fast and requires no extra infrastructure. The risk is that invalidation logic gets complicated quickly, especially if the cached value depends on more than one model. We have seen this pattern done well and done badly, and the difference is almost always in how carefully the invalidation conditions were mapped out before writing any code.

CDN-level cache. For public-facing web content, a CDN cache can absorb the majority of page traffic before it ever reaches Odoo. This is often the highest-leverage option for e-commerce clients with significant public traffic. The implementation work is mostly in the CDN configuration and in making sure Odoo is sending the right cache-control headers for the right responses. Dynamic pages, cart contents, logged-in user views, must never be cached at this layer.

Redis comes up in these conversations regularly. It is a real option, but it introduces operational complexity: another service to deploy, monitor, and keep in sync. For most Odoo Enterprise deployments we have worked with, the right answer has been one of the three patterns above, not Redis. That said, at sufficient scale, Redis starts to look different. The key is measuring before deciding.

The Invalidation Problem

Every caching conversation eventually becomes an invalidation conversation. Serving a cached value is easy. Knowing when that value is no longer valid is the hard part.

The cache that is never invalidated will eventually serve wrong data. The cache that is over-invalidated is barely a cache at all. Getting the middle right requires understanding the data dependencies clearly, and those dependencies are often less obvious than they first appear. A computed price might depend on the product, the pricelist, the currency rate, the customer's discount rules, and the sale order date. If you cache that price and any of those upstream values change, your cache entry is wrong. Mapping the full dependency graph before building the cache is not optional; it is the design work.

This is also why we tend to prototype caching solutions iteratively, walking through the invalidation logic with the client before committing to a full build. The right invalidation strategy becomes visible once you see a working draft; it is almost never visible from a requirements document alone.

Performance Work Starts with Measurement

The patterns above are a starting framework, not a prescription. Caching the wrong thing, or caching the right thing with the wrong invalidation rules, can introduce bugs that are much harder to diagnose than the original slowness. Before committing to any custom caching layer, the question worth asking is: do we actually know where the time is going?

At DimeSoft, we scope performance work after a measured diagnostic phase. We look at query logs, profiling traces, and real usage patterns before recommending a change to the caching architecture. If you are hitting a wall with Odoo cache performance and are not sure whether the native tools have truly been exhausted or whether something more targeted is needed, that conversation is a reasonable place to start. We are happy to look at what you have before telling you what you need.