The EasyCache type exposes the following members.

Constructors

  NameDescription
EasyCache
Class constructor

Load configuration variables once when the class is accessed for the first time

Methods

  NameDescription
AddOverloaded.
AddToAllMachinesOverloaded.
Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Exist
Check if a cache object already exist

Returns false when EasyCache is not Active

Finalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetEnumerator
Retrieves a dictionary enumerator used to iterate through the key settings and their values contained in the cache.
GetHashCode
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Item
Get a cache item

Returns null when EasyCache is not Active

MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
ProcessCachePerRequest
Process a cache request in order to update the caller with the most recent cache updates.

If the cache processing is successful then EasyCache.IndicatorCacheUpdateSentOK will be written to the requester page.

This should be called from all the available machines (when hosted as a Web Farm on more than one machine)

Remarks

It will only process cache if the receiver page is located on one of the allowed listed machine URLs.
Remove
Remove a CacheItem (works also when EasyCache is not Active)

Use RemoveFromAllMachines() in order to support multiple machines.

RemoveAllCacheItemsOverloaded.
RemoveFromAllMachines
Remove a CacheItem and update all machines if any (works also when EasyCache is not Active)

Use this instead of Remove() in order to support multiple machines.

Remarks

When no other machines are defined it will behave as Remove()
ToString
Returns a String that represents the current Object.
(Inherited from Object.)

Fields

  NameDescription
IndicatorCacheUpdateSentOK
Indicator to be used on the cache item receiver page to indicate send success,

This value will be verified through the response to make sure that it was sent successfully.

IndicatorRemoveSimilarItems
Indicator to be used when all remaining similar items have to be removed (all items with the same opening cache key),

It may be required in cases where some of the cache key components cannot be restored.

Remarks

In order to be used simply add this value to the end of a cache key string.
Separator
Seperator to be used within cache keys

Properties

  NameDescription
Active
Indicates if caching is active or not (Read Only)
Count
Gets the number of items stored in the cache
EffectivePercentagePhysicalMemoryLimit
Gets the percentage of physical memory that can be consumed by an application before ASP.NET starts removing items from the cache.
EffectivePrivateBytesLimit
The number of bytes available for the cache.
Get
Get an instance of the class using the singleton pattern for maximum performance

The class can be used directly like a static class without being instantiated

Singleton pattern - http://en.wikipedia.org/wiki/Singleton_pattern

Implementing the Singleton Pattern - http://www.yoda.arachsys.com/csharp/singleton.html

The singleton pattern VS static classes - http://dotnet.org.za/reyn/archive/2004/07/07/2606.aspx

See Also