Wednesday, October 1, 2025
1 change · 19.0
Enhancements to existing features
Website pages now use fewer database requests and smarter caching so they can load faster for visitors. This improves the browsing and shopping experience, especially on high-traffic pages such as the online store.
Original PR description
Drastic website performance improvements This Pull Request brings together a series of optimizations designed to significantly improve website performance by reducing database queries and…
Drastic website performance improvements This Pull Request brings together a series of optimizations designed to significantly improve website performance by reducing database queries and accelerating page rendering. The key changes are as follows: Query and Prefetch Optimization: The code has been refactored to make the best use of Odoo's ORM prefetch mechanism. These changes allow for consolidating multiple data fetching queries into a single one, which improves overall efficiency and performance. XML View Refactoring: The slow fields_get() method has been replaced with the _fields attribute in the template.layout view. This change is sufficient to check for a field's presence without overloading the system with unnecessary processing, resulting in a gain of approximately 8ms per page. High-level Cache Introduction: A new cache has been added to the website.page model to store published pages. This cache can be controlled via overridable methods (_allow_to_use_cache, _allow_cache_insertion, _post_process_response_from_cache), allowing us to optimize rendering time for static or semi-static content. This high-level cache on the `website.page` model, similar to the one that existed before the `t-cache` directive was implemented in `ir.qweb`. see t-cache information and high-level cache (removed when introduce t-cache): - https://github.com/odoo/odoo/pull/224487 - https://github.com/odoo/odoo/pull/88276 When the previous high-level cache are removed: https://github.com/odoo/odoo/commit/0452d0701fcb8f4588b9b05dad9bbdd507539265