NowPublic has a page which tries to find out the locality of the visitors based on her IP. We do not want this page to be cached (obviously). But Drupal provides no mechanism to make a page exempt from caching. By the time the page is loaded from the cache we have settings, database connection, sessions, variables and hook_init is ran. There are quite some tricks you can do even with this limited arsenal, but I found variable overrides in settings.php to be best if ($_GET['q'] == 'local') $conf['cache'] = FALSE;
.
Commenting on this Story is closed.
I maintain the CacheExclude module to allow customized specification of pages to not get cached, but it works by removing from the cache after it's added. That hurts the query cache. I didn't even realize $conf['cache'] existed. I'll have to switch it over to this now. Thanks!