As described in #198, the file cache is unaware of cache hits for files served directly by nginx. This patch notifies PkgServer.jl about nginx cache hits by sending a mirrored request to the internal /notify endpoint. The original request URI is sent through the X-Original-URI header and is used to record the cache hit. In addition, since any cache hits are for files already existing in the cache we can record the size as bytes sent by nginx in a Prometheus counter.
As described in #198, the file cache is unaware of cache hits for files served directly by nginx. This patch notifies PkgServer.jl about nginx cache hits by sending a mirrored request to the internal /notify endpoint. The original request URI is sent through the
X-Original-URI
header and is used to record the cache hit. In addition, since any cache hits are for files already existing in the cache we can record the size as bytes sent by nginx in a Prometheus counter.