vipulnaik / donations

Donations list website (DLW): a repository for keeping track of public donations by some people I (arbitrarily) decide to track
https://donations.vipulnaik.com
Creative Commons Zero v1.0 Universal
20 stars 2 forks source link

Implement smart cache-checking for timeframe plots #147

Open vipulnaik opened 5 months ago

vipulnaik commented 5 months ago

After I implemented https://github.com/vipulnaik/donations/commit/f4bf27adb5bfdb05fa16d6f3a8a8a18aa3eb16d4 + https://github.com/vipulnaik/donations/commit/1dc9cb4834fa509827b2e9711cedb87f0974d1c3 I noticed that the CPU load was still nontrivial, and that Python calls were being made despite this. It looks like the remaining Python calls are being made for timeframe plots.

We currently don't seem to have code in PHP that checks whether the PNG file already exists and was generated with the correct data, so we have no principled way of skipping the regeneration of the PNG file each time.

Fix this by adding a check similar to that used for the yearly graphs.