improved caching for superevent files on the web
Link cache-control: max-age
for superevent files to the public page's
max-age
. Note that this only affects files from /apiweb/, which gets
displayed on the web, and not /api/, which is what is accessed by the
client code.
The public page now caches for five minutes by default. Unfortunately the images on that page are still controlled by the global cache (60s), so they still get pulled requested at a higher rate than the page itself. For example, this skymap image from /api/superevents/...
is dictated by the global cache age on gracedb-dev1
:
But with this patch, the same image, but accessed through /apiweb/superevents/...
shows a max-age
of 300s (the default for the public page) and the http status code shows 304, which means it's a cached copy:
And those changes are being shown on gracedb-dev1
's public page: