api/status: add cache for database metrics to avoid full-table scans