Clear views cache after node inserted in Drupal 7 I've views which list the list of node details. I've set views cache for 30 mins.
I want to clear particular views cache when insert a node.
I've tried below code to clear cache but there is no difference in my page.

function phponwebsites_node_insert($node) {
 if ($node-&gt;type == 'tasks') {
   views_invalidate_cache();
 }
}
The next snippet should work for you

cache_clear_all('MY_VIEW_NAME:', 'cache_views_data', TRUE);