Cache Storage

Evolved Caching can be configured to store full page cache data to either the server filesystem, Redis, APC or to a Memcached server. You can configure this under the Cache Storage Configuration section in admin.

With Files selected as the storage type you don't need to configure anything else in this section. The same is true with Redis and APC selected, however there are optional settings you can configure for both, such as expiration time. With Memcached selected you need to configure as a minimum the Memcached Host and Memcached Port. You can also optionally choose to use a persistent connection to the Memcached server, compress the data stored to Memcached, and define an expiration time for cached items. When using compression you can also optionally set the compression data size threshold and the minimum compression saving.

Note With Files storage type selected, caching data will be stored to the var/evolved/ directory. Take care before deleting all files in this directory as it will also contain user specific data used to load the correct cached page. Clearing cache through admin will intelligently manage these files only deleting them if they have expired. The same applies with Redis, APC and Memcached storage types selected
Information Redis, APC and Memcached storage types can only be selected if they have been configured on your server.

A word about Memcached...

It is worth understanding how a Memcached server works before choosing it as the storage type. When a Memcached server is full the next item to be saved to it causes the oldest item to be deleted. Evolved Caching stores cache data for every different URL, category page sorting combination, currency, store and optionally user agent. If you have a setup with 6000 different products and 500 category pages with cache data for each page being in the region of 100KB (which would be fairly typical), you are already looking at needing 650MB of memory to store the cache data. Add to this CMS pages, category page sorting and mobile stores and you can soon see how the memory requirements for Memcached add up.

Another point worth considering is that when clearing Memcached data, you can't selectively delete cache by tag (which is what Magento attempts to do when refreshing each cache type in admin), you can only delete everything on the server. This means that if you chose to store pages to a Memcached server also used by other caching types, when refreshing cache data for just one of those cache types, cache data for all types will be lost. For this reason if you choose to use Memcached as the storage type, we recommend you use that server only for Evolved Caching and not share it with other caching types.

Finally it's worth noting that the server OS will store files it accesses regularly to memory anyway, and accessing these files will actually be twice as fast as accessing the same data from a Memcached server. So it's likely that many of the most common pages on your site would be served from memory anyway using Files as the storage type. Remember however that you have no control over which files the OS caches to memory.

A word about Redis...

The same limitations apply with Redis as with Memcached, but also Redis should be used an an LRU cache and you need to configure your eviction policy - see this Redis documentation page for more information. Unless you are sure another eviction policy is right for your store, we recommend going with allkeys-lru.

A word about APC...

Whilst considerably faster, when using APC as the storage type many of the same principles apply as when using Memcached. You still need enough memory, and you can't optionally clear parts of the cache, only the entire cache, so again be aware of what user data is being stored to APC before clearing the cache.

If using Redis, APC, or Memcached memory based caching you should consider a suitable caching strategy. Caching to the filesystem is considered to effectively be an infinite resource in applications like this where each cached file is small compared to the total size of the hard drive. Memory of course is a much more valuable resource, not only because there is less storage capacity, but also because it must be shared with the operating system. So from a caching perspective memory should be used intelligently, and managed properly to ensure there is no impact on the memory requirements of both the operating system as a whole, and the web server.

To enable you to properly manage caching to memory, version 1.2.0 of Evolved Caching allows you to define an expiration time for pages cached both to APC and Memcached, and also Redis since support was added in version 1.9.4. With all storage types, when accessing a cached page the expiration time for that page is reset. We recommend you use cache expiration with Redis, APC and Memcached, and and set it to a figure which reflects the traffic to your site such that popular pages remain cached as they are accessed regularly enough, but less popular pages are allowed to expire thus reducing memory usage. Using the correct expiration time combined with a sensible storage capacity will allow you to maintain caching for all of your popular pages while keeping memory requirements under control.