OdooWiki OCA HUB

Endpoint cache

endpoint_cache folder_open OCA/web-api open_in_new
Uncategorised License: LGPL-3

Technical module provide basic caching configuration and utils for endpoints.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Adds a Cache tab to endpoint configuration screens where you can choose how long results are kept (daily, weekly or monthly), see how many cached results exist, view or purge them, and pre-heat the cache.

This module extends the endpoint configuration screens with a new "Cache" tab. There you can set a cache policy: Daily, Weekly or Monthly. The policy decides the time window used when looking for an existing cached result, so results are reused only within the current day, week or month.

The tab also shows a "Cache count" indicating how many cached results are currently stored for that endpoint. Three buttons are available: - "View caches" opens the list of stored cache files (only shown when there is at least one). - "Purge caches" deletes all cached results for that endpoint (only shown when there is at least one). - "Pre-heat cache" clears existing caches and immediately runs the endpoint to rebuild the cache; a warning notes this may take a long time if the endpoint does expensive work.

Behind the scenes, cached results are stored as attachments linked to the endpoint, and a scheduled cleanup automatically removes cache files older than about 32 days. The module works on the endpoint.mixin model and its cache-related helper methods, and it depends on the endpoint module.

Depends on

Required by other modules

Models and fields (1)
  • endpoint.mixin · extends an existing modelcache_policy, cache_att_count (Cache count)

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 2 confirmed, 7 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 18.0

Example of usage in an endpoint:

# get the name of the cache cache_name = endpoint._endpoint_cache_make_name("json") # check if the cache exists cached = endpoint._endpoint_cache_get(cache_name) if cached: result = cached else: result = json.dumps(env["my.model"]._get_a_very_expensive_computed_result()) # cache does not exist, create it endpoint._endpoint_cache_store(cache_name, result)

resp = Response(result, content_type="application/json", status=200) result = dict(response=resp)

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.