It took me a while to figure out that the content will last till expiry for the *lesser* between the global site caching settings (so if your site cache is set to 1 hour, the views cache content will expire before the 3 hour limit hits and vice versa if the global site cache settings are set to longer than 3 hours). In order to try and do some debugging, I wanted to turn off the cache (and be able to play around with how long it lasts). The patch does a few things. It first replaces the cache clear page with a configuration page similar to how the performance page looks. You have the ability to clear the cache from this page with a submit handler (there is a clear cache button) and to set how long the cache can last (from 'do not cache' which sets the time period to -1 so it will always expire to 1 day - same as with performance settings).

Comments

rainbreaw’s picture

We've set up a staging instance of the views language switcher module with this patch, and so far it seems to be working nicely. We'd like to check it again in a couple of days, because it's addressing something that has been hit or miss due to existing caching settings... will check back after we've seen it working a little longer.

We implemented it with btmash's other views language switcher patch found here: http://drupal.org/node/1510724 (respect drupal's caching system).

btmash’s picture

StatusFileSize
new3.36 KB
new1.25 KB

I'm including one other piece of the request in here since it is part of the configuration - it is basically the ability to always show the language link for the view (even if it does not have any content). I'm attaching the patch and the interdiff.

rainbreaw’s picture

Thanks btmash - so far this is working well in the instance in which we are using it!

Reason why this patch was needed for us:
If the user got onto a language that had no content, all of the language links went inactive by default. This left the user stranded on the page they were on, with no content, and no active language links to get them to other translations.

Checking off this little box on the config page keeps all the language links active and gives the user a way out if they get onto a page with no content.