I have a PHP based web application and want to be able to offer mobile users the option to view the content of my site through a dedicated set of 'mobile friendly' pages. The URL structure for the mobile site is different to the desktop site.
The idea is that the first time a mobile user hits the index page, a regexp checks the user agent and if they are a mobile device they are given the option to select to view either the desktop or mobile version of the site.
The problem is that I am caching static HTML with my CDN provider (Cotendo). This means that when the cache is populated the mobile user is likely to see a cached version of the desktop site and bypassing the mobile/desktop option page. It also means that with an empty cache, a mobile user could force the CDN to store the cached version of the mobile/desktop option page!
One option would be to check the user agent at the CDN level and bypass cache retrieval for mobile users. However, a signification proportion of traffic to the site is driven by mobile users and serving non-cached content to mobile users is not currently an option.