Improve theme caching in large instances

Description

In Confluence instances with many users accessing viewports at the same time, the current theme cache warmup can cause an increase in blocked database connections.
This happens because the warmup synchronizes all requests to viewport themes and blocks them until the warmup has been completed. During that time the respective threads hold onto their database connection and return them to the connection pool only after the warmup has been completed.
If the warmup takes several seconds this can easily deplete the DB connection pool.

Environment

None

Assignee

Unassigned

Reporter

Sync User [K15t]

Labels

Participants

None

Deployment

None

Time tracking

2h

Components

Sprint

None

Fix versions

Configure