r-universe-org / help

Support and bug tracker for R-universe
https://docs.r-universe.dev/
9 stars 2 forks source link

Caching index files #295

Closed jeroen closed 11 months ago

jeroen commented 12 months ago

Server is under heavy load due to repeated calls from indexing the cran metadata:

cranlike    | GET /cran/src/contrib/PACKAGES 200 638.889 ms - -
cranlike    | GET /cran/src/contrib/PACKAGES 200 473.937 ms - -
cranlike    | GET /cran/bin/linux/jammy/4.3/src/contrib/PACKAGES.gz 200 919.816 ms - -
cranlike    | GET /cran/src/contrib/PACKAGES.gz 200 902.230 ms - -

We should cache these better.

jeroen commented 12 months ago

Maybe the new pak client for the wasm builds causes heavy load.

jeroen commented 11 months ago

Server is now checking etags again: https://github.com/r-universe-org/cranlike-server/commit/87f9b000dff6f623cea118ab67dee8d46e22164b Also setting proxy_cache_revalidate on in nginx to enable shared cache.

jeroen commented 11 months ago

This seems to work! The first 10 seconds of refreshing we get:

< x-runiverse-cache: HIT

And after 10 sec we get:

< x-runiverse-cache: REVALIDATED

Even from a different client.