The Mobile theme module conflicts with the default cache
I don't think there's a straightforward solution to this in Drupal7 but there are some workarounds available:


Use JavaScript to detect and do the switch
This issue happens because D7 uses page URL as page's cache id (CID). To distinguish different devices for same page, you'll need to alter the CID somehow so it looks something like CID_phone, CID_tablet and CID_desktop. I used mobile_detect module before and know there are some patches on this. Do keep in mind there's a side effect that this approach will triple the amount of CIDs in you database table.
If you use Varnish you can try something like this