Page caching with multiple versions of the cache 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-&gt;query-&gt;set_distinct(TRUE);
  $invert = $this-&gt;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)-&gt;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-&gt;options['office_not_set'];
  }

  $join = new views_join();

  $join-&gt;definition = array(
    'table' =&gt; 'taxonomy_index',
    'field' =&gt; 'nid',
    'left_table' =&gt; 'node',
    'left_field' =&gt; 'nid',
  );
  $join-&gt;construct();
  $this-&gt;query-&gt;add_table("taxonomy_index", NULL, $join);
  $this-&gt;query-&gt;add_table("taxonomy_index", NULL, $join, "taxonomy_index_for_office");

  $this-&gt;query-&gt;add_where_expression($this-&gt;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.")");
}
If you're using Varnish, you can simply add the cookie as a hash key - there's lots of information about how to do this.

One example and one based on mobile devices.

If you mean Drupals internal page cache then maybe look to this module.