First, I second Ran Bar-Ziks suggestion of putting the 'not to be cached' data in a separate block and set that block to BLOCK_NO_CACHE, as it is the simplest solution.
If that is not possible, you can disable caching of specific pages, but contrary to the suggestion from the link you posted, I'd do this by preventing the page from getting cached in the first place (rather than removing the cache entry afterwards).
To do this, you can manipulate the global cache config setting temporarily on the page in question:
// Disable caching for this request cycle
$GLOBALS['conf']['cache'] = FALSE;
Where you put this code depends on the pages you want to exclude from caching:
- If it is a custom node type coming from your own module, you'd put it in
hook_view.
- If you want to do this for a node type coming from other modules, you can put it in 'view' operation part on a
hook_nodeapi() implementation.
** This would also also work for individual nodes, if you add a check for the node id before disabling the cache.
- If you need to do this based on paths, you could put it in a
hook_init() implementation, checking for the path (or path alias) to decide whether to disable caching or not.
It should be obvious that you need to clear caches first for any of these approaches to work, as they depend on preventing the page from being cached at all. They will not remove an already paged entry from the cache.