aboutsummaryrefslogtreecommitdiff
path: root/internal/queue/inmemqueue
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2026-04-07 18:52:05 -0400
committerJonathan Amsterdam <jba@google.com>2026-04-08 13:35:34 -0700
commitb0096dc799437fdf92fc65135a7141fa8ad358be (patch)
tree59514073b525d15fd7917f424d0228ded51e67b9 /internal/queue/inmemqueue
parent0ef8af41d6814a34f239b02ab621c4cfcb8c0019 (diff)
downloadgo-x-pkgsite-b0096dc799437fdf92fc65135a7141fa8ad358be.tar.xz
internal/api: set cache-control headers
Set an HTTP Cache-Control header for all API responses. Since requests that reference a specific, numbered version apparently always produce the same response, it is tempting to use the "immutable" Cache-Control directive so these pages can be cached indefinitely. But occasionally we must exclude a module. It would be unfortunate if the module's data lived in caches forever. Instead, we cache such pages for one day. Pages that are subject to more rapid change, like those with versions "latest", "master" and so on, or those that depend on data other than a module (imported-by, search, etc.) are cached for an hour. That is an arbitrary value that seems like a good compromise, since the likelihood of a particular page's value changing in an hour is low. Change-Id: I21414c22c724220c993c1dd7e7a0b49074efd8b9 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763782 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/queue/inmemqueue')
0 files changed, 0 insertions, 0 deletions