diff --git a/swh/web/common/utils.py b/swh/web/common/utils.py --- a/swh/web/common/utils.py +++ b/swh/web/common/utils.py @@ -458,7 +458,13 @@ ingested into the archive. """ try: - return sorted(search().visit_types_count().keys()) + cache_key = "origin_visit_types" + cache_timeout = 24 * 60 * 60 # 24 hours + visit_types = cache.get(cache_key) + if not visit_types: + visit_types = sorted(search().visit_types_count().keys()) + cache.set(cache_key, visit_types, timeout=cache_timeout) + return visit_types except Exception: return []