Click or drag to resize

SimpleFileCache Class

A simple utility class that uses a temp folder as a cache for strings.

NOTE: Two versions of this class used to exist, one for objects serialized as XML and one for JSON. Having this tiny library depend on a JSON library was a heavyweight burder and caused version clashes with calling apps, so this class remains and it simply saves and restores plain strings. It's the callers job to perform the serialization.

Inheritance Hierarchy
SystemObject
  Orthogonal.Common.BasicSimpleFileCache

Namespace: Orthogonal.Common.Basic
Assembly: Orthogonal.Common.Basic (in Orthogonal.Common.Basic.dll) Version: 2024-04-29 08:29 GMT+10
Syntax
C#
public static class SimpleFileCache

The SimpleFileCache type exposes the following members.

Methods
 NameDescription
Public methodStatic memberGet Attempts to get a string from the cache if it is not older than a specified expiry time in minutes.
Public methodStatic memberPut Puts a string into the cache.
Top
Remarks
This is a very simplistic class, created for internal use in a few projects. You would prefer to find a professional implementation of a caching algorithm. As a challenge, you could derive a suitable class from the abstract System.Runtime.Caching.ObjectCache class (although there are a lot of methods to override, so it could be hard work).
See Also