It's horribly inefficient to rebuild the reporting from individual contributions. It's also pointless to ever rebuild in real-time (triggered by expired cache).
Instead, I propose aggregating from a cron job, or in the db trigger -- a trigger on public_reporting could update public_reporting_days, along these lines:
new_total = cur_total + amount;
new_number = cur_number + 1;
new_average = (cur_average * cur_number + amount) / new_number;
Version: master
Severity: enhancement
Whiteboard: wikimedia[unmaintained]