cacheByVars default values

cacheByVars is a view decorator who's values are used by the caching layer to identify unique views of the same webskin and object. For example, a single webskin has a paginated result set that means there is a different output depending on page number using something like URL.page.

The vars that might impact the caching are accessed and hashed BEFORE the webskin is executed in order to identify if that execution can be avoided. Unfortunately, there can be a problem if the webskin/view cfparam's one of these variables: the cache layer looks for an item with a null for that variable and doesn't find it, then afterwards caches the item where the variable DOES have a value.

You'll see a fix for this coming through in 6.0.6, where we've added support for defining a default cacheByVars value in the decorator:

<!--- @@cacheByVars: url.page:1 --->

In cases where the variable is not found by the caching layer, it is treated as being equal to the specified value instead. Variables with no defaults are still supported. 

3220 views and 0 responses