We all know our Drupal sites can gain a huge performance boost by enabling page caching. But sometimes, you want to exclude certain pages from being cached.
One option to do such a thing is using a small module called CacheExclude.
You might also opt to program this yourself in your own modules by setting the cache variable to FALSE. Variables can be set temporarily for the current request by setting the global array conf.
A small example might clarify things. We're disabling caching on the front page here (not a thing you'd like to do every day, but it's an example ;)).
if (drupal_is_front_page()) {
$GLOBALS['conf']['cache'] = FALSE;
}
Quick note to people who have page caching on on their site:
If you move your site to a new url, don't forget to flush your cache_page table after moving the site since Drupal uses the full url (including the domain name etc.) as the cache key.