Cache work and bookmark counts on dashboard sidebar

Description

Dashboard sidebars retrieve work and bookmark counts from Elasticsearch, which creates long running queries especially on users or pseuds with a lot of works and bookmarks. We need to cache these counts. The cache time should be configurable.

Series counts come from the database and they're not as much of a problem, but let's cache them anyway. See AO3-5829.

Note: We've added a workaround in nginx that renders /users/orphan_account/pseuds/* pages as 404. We can remove that once caching is in place.

How to test:

  • Check that the dashboard work count is eventually updated after a work is created / deleted / posted from draft / (un)revealed.

  • Check that the dashboard bookmark count is eventually updated after a bookmark is created / deleted / made private / made public.

Environment

None

Status

Assignee

redsummernight

Reporter

redsummernight

Roadmap

Browse

Priority

High

Affects versions

Fix versions

Components

Caching

Difficulty

Medium

Required Access Level

None

Milestone

Internal 0.9
Configure