I'm using memcache on my server (see #1121034: Default (simple) config for Drupal 7).

If I set a view to cache its output, filters (or arguments) are not considered: the first called is the cached one and all forthcoming requests are giving a very fast response with the same – cached – output, no matter if there is a different argument passed…

Is there any configuration I'm missing…? How can I tell views to cache accordingly to exposed filters or arguments received?

Comments

dawehner’s picture

Title: Views with Memcache: Filters and Arguments » Views with Cache: Filters and Arguments

If this is related to Memcache, views can't do something, but this is probably a problem with caching itself

tomgf’s picture

Isn't there any way of setting a key…? For instance I am setting this in my settings.php file to separate the cache for different websites, in a multi-site environment:

$conf['memcache_key_prefix'] = 'UNIQUE_TO_THIS_WEBSITE';

Thinking about arguments, http://hostname.tld/view/display/{%ARGUMENT} is unique and related to the argument value…

Aside Memcache, how is this working with other caching settings…?

dawehner’s picture

Views generates a cache key based on some values, for example the current user rules etc.

This cache key is used when retrieving the cache.

dawehner’s picture

tomgf’s picture

I had the time to check how these keys are created. So far, I don't see any reference to an argument – or reference to an exposed filter – on these two functions: function get_results_key() and function get_output_key().

I also found out that there is a proposed patch here #1055616: Query arguments should be replaced before generating cache ID, which is helping in some cases but also ignoring arguments (as far as I understand).

I will add an extra line to the proposed patch there to incorporate arguments in the key creation process.

johnv’s picture

Category: support » bug
Status: Active » Closed (duplicate)

marking as duplicate of #1055616: Query arguments should be replaced before generating cache ID .
@tomgf, IMO it also addresses arguments, (CU over there :-) )