[WIP] A caching proxy for the
/@latest endpoints for Athens.
This is useful in situations where users of a proxy might run a lot of
go get commands without versions on them. Similarly, a user might add a new
import in their code and run a
go build. In these cases (and others!), these endpoints will get hit.
Athens gets up-to-date information from the upstream VCS when handling both the
/@latest endpoints. If you cache the values for these endpoints, you can reduce Athens' dependence on the upstream VCS systems. If you store the values forever, you can completely isolatet Athens from the upstream.
In most situations I've seen so far, caching or storing
/@latest isn't really needed. There are two where the isolation is really handy:
- You're running a public proxy like athens.azurefd.net and you don't know when and how many "bare"
go getcommands will hit the server
- Caching these values helps prevent Athens from making tons of VCS requests
- You're running an Athens deployment that is completely shut off from the public internet, and want to pre-seed the
You can use this with any other Go module proxy server as well
Why not just use a caching proxy?
A caching proxy generally works great. There are two reasons to have a custom one:
- Athens itself can send a webhook to this server to notify that there are new version(s) available
- crathens can send new version(s) to lathens as it crawls. Lathens then won't need to go ask Athens for new versions in that case