TinyCache plugin

TinyCache is a size-limited disk cache (30MB, max 1024 cache items). It writes to a single file located at ~/App_Data/tiny_cache.cache.

The cache is stored in RAM, but periodically flushed to disk so that it can survive application restarts. It uses ProtoBuf to serialize the cache structure to disk quickly.

Cache loading and flushing occurs during the processing of certain requests, not on a background thread. To prevent sporadic request failure or timeout, it is important that the cache file remain small enough that it can be flushed to disk within a few seconds.

As individual files are not written for each cache item, it does not use IIS or the StaticFileModule, and therefore can't leverage the existing etag and Last-modified support.

The design goals for this plugin are (a) fixed-size persistent cache, and (b) simplicity. DiskCache is preferred for nearly all real-wold scenarios. TinyCache does not offer any configuration parameters.

Installation

Either run Install-Package ImageResizer.Plugins.TinyCache in the NuGet package manager, or:

  1. Add ImageResizer.Plugins.TinyCache.dll to your project
  2. Add <add name="TinyCache" /> inside <resizer><plugins></plugins></resizer> in Web.config.

This plugin (TinyCache plugin) is part of the Essential edition

Where is the plugins section?

The <plugins> section is located in Web.config, and is nested inside the <resizer> element, which is nested inside <configuration>. For examples, see this sample Web.config file.

Where can I find the dll?

We prefer that you install via NuGet, but you can also find the plugin DLL files in the /dlls/release folder of your download.

How do I typically install a plugin via Web.Config?

  1. In Visual Studio, right click on your project and choose "Add reference". Browse to the plugin DLL and click "OK".
  2. In the <plugins> section of Web.config, insert <add name="PluginName" />
  3. Look at the plugin documentation to see what configuration options (if any) are available.

How do I typically install a plugin via code?