EBSECan / donatemask

Donate A Mask Project Repository
GNU Lesser General Public License v2.1
10 stars 7 forks source link

Add explicit cache-control for /api/* routes to avoid stale content #109

Closed humphd closed 2 years ago

humphd commented 2 years ago

@emmaelaine alerted me to a bug in my stats code, where the browser aggressively caches the old values despite new numbers being available in the database.

This is caused by Passenger/Apache adding a default cache-control: max-age=172800, which will cache the stats/messages for 2 days.

This fix adds explicit cache instructions for these routes, so that we'll update more frequently.