My site is very much faster with page caching on. However, I have a custom module that serves 5 different slightly different versions of my content. In other words, people in New York see East Coast stories, but not California stories, but everyone sees national stories. This is mostly done through a custom Views filter that checks for a cookie.
Each node is tagged with an internal taxonomy that determines which areas to show that content in lists generated by views. The actual content isn't hidden or different based on the cookie, just the lists of events, local stories, etc.
Is there a way of serving cache A to people with cookie A, cache B to people with Cookie B, etc?
Code from the custom Views filter-
function query(){
$this->query->set_distinct(TRUE);
$invert = $this->options['invert'];
//Get the taxonomy id corresponding to the user's location from a cookie.
$office_tid = MCC_location_get_cookie("tid");
//Get the taxonomy id of the country- code used on 2 sites
$country_name = variable_get('MCC_location_site')?"U.S.":"Canada";
$country_tid = taxonomy_get_term_by_name($country_name,'regions');
$country_tid = current($country_tid)->tid;
if($office_tid == $country_tid){
// An area without an office was selected, such as Yukon, filter should act as if no province has been selected
$case = $this->options['office_not_set'];
}
$join = new views_join();
$join->definition = array(
'table' => 'taxonomy_index',
'field' => 'nid',
'left_table' => 'node',
'left_field' => 'nid',
);
$join->construct();
$this->query->add_table("taxonomy_index", NULL, $join);
$this->query->add_table("taxonomy_index", NULL, $join, "taxonomy_index_for_office");
$this->query->add_where_expression($this->options['group'], "taxonomy_index_for_office.tid = ".$office_tid." AND taxonomy_index_for_office.nid NOT IN (SELECT taxonomy_index_for_office.nid FROM taxonomy_index AS taxonomy_index_for_office WHERE taxonomy_index_for_office.tid = ".$country_tid.")");
}