msys2 / setup-msys2

GitHub Action to setup MSYS2
https://github.com/marketplace/actions/setup-msys2
MIT License
282 stars 36 forks source link

Cache package databases #335

Open lazka opened 8 months ago

lazka commented 8 months ago

In theory these files could be cached, to speed up updating:

$ ls /var/lib/pacman/sync/
clang32.db         clang64.files         mingw32.db         mingw64.files      staging.db
clang32.db.sig     clang64.files.sig     mingw32.db.sig     mingw64.files.sig  staging.files
clang32.files      clangarm64.db         mingw32.files      msys.db            ucrt64.db
clang32.files.sig  clangarm64.db.sig     mingw32.files.sig  msys.db.sig        ucrt64.db.sig
clang64.db         clangarm64.files      mingw64.db         msys.files         ucrt64.files
clang64.db.sig     clangarm64.files.sig  mingw64.db.sig     msys.files.sig     ucrt64.files.sig

It will still hit the repo and mirror but should result in a 304 in most cases, assuming the mtime gets restored correctly.

Question is if we should cache them separately. Probably better, assuming we restore in parallel, since they might change more often than packages and invalidate the caches needlessly otherwise.

lazka commented 3 months ago

Since https://github.com/msys2/msys2-main-server/commit/a70664ca6cdc32b3c3efa520d7e1b606412283ad we no longer hit the mirrors when checking an up-to-date DB, which shaves of another 400ms if we implement this.