Caching is most effective for content that requires expensive, re-usable resources or computations to generate it. Some collection filtering components, such as StartEndDateFilter, are ideal for caching because the content they produce applies to a broad spectrum of users for a sizable period of time. It is more efficient for StartEndDateFilter to cache its result once a day rather than compute the same collection of objects for each request.

Caching is a waste of resources for collection filtering components when the input collection changes frequently. A site wide search, for example, would render a list of results, the contents of which would not likely be identical to other result sets. Another poor candidate is a collection filter that takes a user’s birthday as a criterion because the cached content is only reused for users with the exact same birthday. In this instance, too many resources are spent to store content in the cache and too few users access it for caching to be worthwhile. Consider that balance when you are deciding when to use filter caching.

Although caching isn’t appropriate for some collection filters that use Profile conditions such as a zip code or items on a wish list because such content is too specific, caching is appropriate for other Profile-related conditions, such as those that use state or gender.

 
loading table of contents...