| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 272 |
| Technical Name |
open_redis_ormcache |
| License | OPL-1 |
⚡Redis ORM Cache
Shared ORM cache for Odoo 18. Activates only when ormcache_redis_url is set, keeping workers and servers in sync while cutting database reads.
✨Key Features
Distributed Cache, Opt-In
Replaces registry caches with Redis-backed caches only when ormcache_redis_url is configured, keeping default in-memory caches untouched otherwise.
Generation-Based Invalidation
Each cache has a generation key. Incrementing it drops the entire cache atomically, so no stale reads appear during a flush.
Configurable TTL
Values are stored with SETEX using ormcache_redis_expire (default 7 days) to keep Redis size controlled.
Safe Fallback
If Redis is missing or fails, the module logs the issue and safely leaves Odoo's standard in-memory caches in place.
🚀Installation & Configuration
- Install the Python dependency:
pip install redis. - Place
open_redis_ormcacheinside your Odoo addons path. - In your
odoo.conffile, add the following key-value pairs:[options] ormcache_redis_url = redis://localhost:6379/0 ormcache_redis_expire = 604800 ; optional, TTL in seconds (default 7 days) - Restart your Odoo server to apply the patch.
- Go to Apps, update the app list, and install the "Redis ORM Cache" module.
- On startup, you should see logs confirming the Redis connection.
🎯When to Use It
- Deployments with multiple workers (
--workers > 0) on a single server. - Load-balanced or containerized environments serving requests from multiple Odoo nodes.
- Any setup that needs predictable cache invalidation while reducing repeated database reads.
- It's safe to keep installed even for development (
--workers 0), preparing you for future scaling.
⚙️How It Works Internally
- Monkey-patches
Registry.initonly when the config key is present. - Creates one
RedisLRUper registry cache, namespaced by database. - Clears a cache by incrementing a generation key, avoiding stale reads.
- Skips caching callables to avoid storing functions in Redis.
- Uses guarded serializers for safe and consistent key generation.
- Leverages Redis
SCANfor non-blocking iteration and sizing.
📞Support & Feedback
This module provides an essential caching layer for scalable Odoo deployments.
We'd love to hear your feedback and feature requests!
Email: roshankumar402@gmail.com
Share your opinions, bug reports, and feature suggestions to help us improve this module for the Odoo Community!
Boost Your Odoo Performance Today!
Install now and give your Odoo application the speed and scalability it deserves ⚡
Made with ❤️ for the Odoo Community
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module