Version 3.0.0
Pre-releaseNew in Version 3
Version 3 allows for the building of custom caching schemes. The first release contains
two caching schemes, Basic
and Hashed
.
The Basic scheme is the tried-and-true scheme employed in all prior versions of FC. When
using the Basic scheme, file names are taken from the cache key. For example, executing
the command simpleCache["foo"] = foo;
will create a foo.dat
file
to store the value of foo. This plaintext conversion can be convenient when debugging
or when accessing FC cache values from outside of FC. However, it also has the
downside of not supporting cache key names that cannot be used in file names (e.g. /).
Rather than using key names as file names, the Hashed scheme, introduced in Version 3.0,
uses hashed representations of key names using the built-in .NET function
GetHashCode()
. This function produces a numeric representation of each key that is
guaranteed to produce a valid file name. However, the downside of this approach is
that GetHashCode()
is not guaranteed to produce a unique key. Therefore, FC must
account for collisions when using the Hashed scheme. This slight overhead is likely to
correspond in slighly higher cache retrieval times.
For now, the default caching scheme is set to Basic
in order to maintain compatibility with
prior releases. Furthermore, while the Hashed
scheme passes all unit tests, it should
be treated as experimental until additional field testing has been conducted.