How to setup Page Cache to work with the Flag Module and Views? I have a Site where Views are used to display flagged Nodes.
When i turn on Cache Pages for anonymous Users, the anonymous Users only see the change in the Views until the cache is cleared. (If logged in no problem). What is the best Way to deal with this caching issue. I would prefer that all pages with views where item flags are updated would be recached. Is this possible ?
Similar to the first answer but not assuming your cache is in the database. (memcache, redis, apc, etc)

function hook_flag_flag($flag, $entity_id, $account, $flagging) {
  $view_name = '&lt;view_name&gt;';
  $display_id = '&lt;display_id&gt;';
  $cid = $view_name . ':' . $display_id . ':*';
  cache_clear_all($cid, $bin = 'cache_views_data', $wildcard = TRUE);
}