nox icon indicating copy to clipboard operation
nox copied to clipboard

Nox unnecessarily invalidates cache

Open Adjective-Object opened this issue 8 years ago • 2 comments

Nox's cache expires after 1 hour, regardless of if any expressions in the underlying nix channel have changed (this section of cache.py:).

region = make_region().configure(
    'dogpile.cache.dbm',
    expiration_time=3600,
    arguments={'filename': '/tmp/nox.dbm.'+getpass.getuser()}
)

As most nix channels are also git repositories, the HEAD commit's hash & status of the containing repo could be used to check the validity of the cache. At the very least this would stop the re-evaluation of the nixpkgs repo, which is likely the largest time sink for most users.

In the case of a non-git nix channel, a 1 hour cache timeout could be used as a fallback.

Adjective-Object avatar Mar 15 '16 15:03 Adjective-Object

https://github.com/madjar/nox/pull/60 I've taken this approach for myself.

lheckemann avatar May 10 '17 09:05 lheckemann

I would still like a more intelligent cache invalidation as described in OP.

lboklin avatar Jun 24 '20 07:06 lboklin