Click or drag to resize

SimpleFileCache Class

A simple utility class that uses a temp folder as a cache for XML serialized objects.
Inheritance Hierarchy
SystemObject
  Orthogonal.Common.BasicSimpleFileCache

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

The SimpleFileCache type exposes the following members.

Methods
 NameDescription
Public methodStatic memberGetT Attempts to get an object from the cache if it is not older than a specified expiry time in minutes.
Public methodStatic memberPutT Puts an object 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). Note also that this class uses XML serialization, which can crash if the object being processed is a graph of objects that contains circular references.
See Also