How to cache a separate wordpress template?

How to cache a separate wordpress template?
Good afternoon.
There is a site on wp, 500+ pages.
Home page for mobile devices should differ from desktop version.
With it differ dramatically.
So I decided to get out of this situation in this way:
In the template home page - page-home.php wrote a simple condition:
<?php /* Template Name: Home */ ?>
<?php
if(wp_is_mobile()):
include_once("page-home-mobile.php");
else:
include_once("page-home-desctop.php");
endif;
?>


Now open different templates for different devices. But there's a problem with the caching plugin (wp fastest cache), it caches the page and always given an option: either mobile version or desktop. It should not be.

Non-cached download speed is not happy, as many database queries on the page.

Is it possible to cache a separate php templates? Maybe there is a more serious plugins that allow you to control caching?

upd: by "cache" you mean creating a static copy
March 20th 20 at 11:30
2 answers
March 20th 20 at 11:32
Ask yourself the question, how does the plugin know what you've done in the template? You need a plugin that will change the template and will be cached. If no, then write your crutch.
March 20th 20 at 11:34
About the plugin wp fastest cache does not know, but in the plugin WpSuperCashe there is a option that allows you to cache different pages for mobile and desktop version

Find more questions by tags WordPress