Monday, September 15, 2025
1 change · master
Enhancements to existing features
Website pages now use fewer database requests and improved caching to render more quickly. This should make browsing Odoo websites feel faster and reduce server workload, especially on pages with mostly static content.
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.