Bypassing drupal cache in template file
The entire page is being cached, so you'll want to disable caching on those pages that have dynamic elements. I think you'd want to:

a) turn OFF page caching for the needed paths (http://drupal.org/project/cacheexclude)
b) turn ON caching for any Views, blocks, or whatever else you can cache on those pages to save bandwidth

Then you'll have more granular caching control.