Skip to content

common/utils: Use cache in origin_visit_types function

That function is used to dynamically retrieve the list of origin visit types (git, svn, npm, ...) currently supported by Software Heritage.

That list of visit types is then used to populate the visit type dropdown in the search form available in the home and search pages of the web application.

However getting that visit types list is costly as it involves sending an elasticsearch query through the use of swh-search.

So instead of sending that costly query each time a search form must be rendered, prefer to cache the visit types list and update it every 24 hours.

That change significantly speedup the homepage rendering of the web application.

Depends on !785 (closed)


Migrated from D7521 (view on Phabricator)

Merge request reports