Uncompatible to Jetpack_is_mobile
as8564 opened this issue · 6 comments
Hi I am using jetpack_is_mobile and batcache doesnt seem to support it and is saving only a single copy.
You'll want to add a cache variant for that, although you'll need to do it without that function because it won't be defined yet. Either that, just turn off caching for mobile views.
Many easier to use (but not as slim) caching plugins such as WP Super Cache support this out of the box.
Regardless, it's not a Batcache bug so I'm closing this.
jetpack_is_mobile is inbuilt function of jetpack plugin by Automattic, shouldn't batcache support it ?
This is not for Automattic to support. Your integration is up to you. However, how batcache is used in wordpress VIP might be useful.
https://github.com/Automattic/vip-quickstart/blob/master/www/config/batcache-config.php#L85
Ok could you guide me how to do it ... Jetpack plugin has become a standard for wordpress sites along with batcache plugin.
It is pretty complex. Basically that link above is what wordpress.com does and they use batcache and jet pack. The only two things you should really look for is the following.
You need load the user agent code earlier in the bootstrap process. Like they have done in the following line. https://github.com/Automattic/vip-quickstart/blob/master/www/wp-config.php#L86
When you can use the batcache confit file above. You should already be adding custom batcache config in your wp-config.php . The above is a good starting point. I can't really explain it anymore than that, as you need to create your own caching rules as they differ from project to project.
Thanks a ton , this would definitely help. :)