Hiya,

As I was going through the module for a site I'm working on, I found clearing the views_lang_switch cache was hardcoded (so it cannot be used in a prefix) and it didn't actually seem to use the caching system (aside from the call via cache_get()). I'm attaching a patch which uses cache_clear_all() to clear out the cache and implements hook_flush_cache to clear out expired entries when the cache is requested to get cleared out. The other gain, however, would be that since its working via the cache system, we can now use other caching backends if need be.

I think perhaps updating hook_install() to use drupal_get_schema() to get the way the cache tables are created would also be a good idea but baby steps :)

CommentFileSizeAuthor
#2 1510724.2.patch763 bytesbtmash
vls-pluggable-cache.patch744 bytesbtmash

Comments

rainbreaw’s picture

We've set up a staging instance of the views language switcher module with this patch, and it hasn't broken anything :) and so far has made handling the VLS cache easier. We implemented it with btmash's other views language switcher patch found here: http://drupal.org/node/1510732 (Provide a configurable way to set expiry period of the content).

btmash’s picture

StatusFileSize
new763 bytes

I've created a diff based on the work at #1510732: Provide a configurable way to set expiry period of the content. so they patch well together.