lychee icon indicating copy to clipboard operation
lychee copied to clipboard

support relocating `.lycheecache`

Open sdavids opened this issue 7 months ago • 3 comments

https://lychee.cli.rs/recipes/caching/

--cache-location some/path/lychee/cache --cache-location /other/path/lychee/cache

also:

https://github.com/lycheeverse/lychee/blob/master/lychee.example.toml

Other tools:

https://eslint.org/docs/latest/use/command-line-interface#--cache-location https://prettier.io/docs/cli#--cache-location

sdavids avatar May 15 '25 10:05 sdavids

Sounds good. What's your use-case?

mre avatar May 15 '25 22:05 mre

The main advantage is not having a required .lycheecache entry in your .gitignore.


  • global cache directory ($XDG_CACHE_HOME/lychee/cache, $HOME/Library/Caches/lychee, %LOCALAPPDATA%\lychee\Cache …)—depending on your OS, files in those directories are not backed up or indexed, cleaned on system reboot, and/or placed on an in-memory mount.

  • a directory already in your .gitignore, i.e., node_modules/.cache/lychee/cache

In the latter case, you could also keep your tools' caches all in one place:

eslint --cache --cache-location ./node_modules/.cache/eslint/.eslintcache
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "tsBuildInfoFile": "./node_modules/.cache/tsc/tsconfig.tsbuildcache"
  }
}

https://prettier.io/docs/cli#--cache-location ⇒ ./node_modules/.cache/prettier/.prettier-cache

sdavids avatar May 16 '25 07:05 sdavids

I see. So it's mostly a quality-of-life improvement, not a blocker, right?

I like the idea and the new parameter name. We'd accept a pull request for that in case someone wants to give it a shot.

mre avatar May 16 '25 10:05 mre