5.6 FPC with mobile theme

Permalink
Scenario:
- Customer has a 5.6 website and wants to redirect visitors to mobile page depending on an attribute and whether visitor is on a mobile device.
- Customer has Full Page Caching (FPC) enabled and disabling it is gonna make the website significantly slower.

What are the options?

Would the best option be to modify the dispatcher.php so $c is being loaded before check_page_cache.php?

A3020
 
Mainio replied on at Permalink Best Answer Reply
Mainio
You could also just override /libraries/page_cache/types/file.php. Or even create your own cache type based on that and define it with:

define('PAGE_CACHE_LIBRARY', 'your_type');


Actually, this might be even better solution as it wouldn't possibly conflict with any upcoming changes to the file cache type.
A3020 replied on at Permalink Reply
A3020
Thanks for pointing this out. I did some testing and yes, it seems totally possible. At the moment I'm overriding PageCacheRecord and I've added a few custom properties to the cache record. In the FilePageCache override I've changed the 'deliver' method that checks for certain properties in the cache record and optionally redirects a user.

Cool. Thanks again.