Page body content updated only after second load I want to programmatically update the HTML contents of a page (a node of bundle type 'page') on my Drupal 7 site, by doing the following:

function my_page_generate() {
   // Find and load the page I want to update (can't do it by nid since
   // it might differ)
   $query = new EntityFieldQuery();
   $entities = $query-&gt;entityCondition('entity_type', 'node')
   -&gt;propertyCondition('type', 'page')
   -&gt;propertyCondition('title', 'Last News')
   -&gt;propertyCondition('status', 1)
   -&gt;execute();
   $node_key = array_keys($entities['node']);
   $node = node_load($node_key[0]);

   //Update its HTML contents
   $node-&gt;body[LANGUAGE_NONE][0]['format'] = 'full_html';
   $node-&gt;body[LANGUAGE_NONE][0]['value'] = '&lt;h1&gt; BREAKING NEWS &lt;/h1&gt;';

   node_save($node);

   return node_view($node, 'full');
}


This method is called when requesting a URL by using the hook_menu hook, like this:

function my_module_menu() {
   $items = array();
   $items['last-news'] = array(
    'title' =&gt; 'Last News',
    'page callback' =&gt; 'my_page_generate',
    'menu_name' =&gt; 'main-menu',
   );

   return $items;
}


However, when I navigate to /last-news on my site, the old contents of the page are displayed. If then I reload the same page again (using the same path), the new contents I created show up. I have tried to disable the page cache for this page by calling $GLOBALS['conf']['cache'] = FALSE, but it keeps showing the same behavior.

Any ideas how to solve this?
Check http://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_view/7 

You should clear cache programmatically if you want to use current solution or just load node again (http://api.drupal.org/api/drupal/modules!node!node.module/function/node_load/7) after save. 

Third argument of node_load must be true