Skip to content

v0.1.9

Compare
Choose a tag to compare
@jodydonetti jodydonetti released this 24 Nov 10:28
· 447 commits to main since this release

This is a small release, in preparation of the big one where the Backplane #11 will be added 🎉.

🆕 Added CacheName

It is now possible to specify a cache name, namely a logical name that identify a cache.

It can be used for identification, and in a multi-node scenario it is typically shared between nodes to create a logical association that may be useful to have them communicate together (ref Backplane).

It is possible to specify it in the FusionCacheOptions, and is acessible as a read-only prop directly on any FusionCache instance.

🆕 Added InstanceId

Each time a new FusionCache instance is created (eg: via a new FusionCache(...) directly or via DI) a new id will be generated, globally and uniquely identifying that specific instance.

It can be useful to uniquely identify a single instance in a multi-node scenario, for example to precisely route notifications to each one (ref Backplane).

It is acessible as a read-only prop directly on any FusionCache instance.

🆕 Added Evict method

A new Evict method has been added: this method evicts an entry from the cache, like the Remove method, but with 2 very important differencs:

  • it only act on the primary layer (memory cache) and does not propagate the removal in the distributed cache, if any
  • it does not raise a Remove event

Again, this is useful in the Backplane that is coming.

It is only available in a sync fashion and not in an async one, since it acts only locally and there's nothing to do asynchronously.

⚠ Marked CacheKeyPrefix as [Obsolete] for future removal

The CacheKeyPrefix option is now obsolete: it still works, but will be kinda removed in the next version.

See here for more info.

🚀 Performance

Added a couple of small perf optimizations here and there.