I installed wp-postviews on site with Cache Enabler plugin activated.
Using standard, not async code provided in Readme <?php if(function_exists('the_views')) { the_views(); } ?>
caused common problem with not updating current views (as I expected - this page is rendered and written to cache).
The only way for now is to clear cache manually and decrease cache lifetime.
But I can see that you provided some async code using JS and LiteSpeed Cache: jQuery.ajax({
type:"GET",
url:viewsCacheL10n.admin_ajax_url,
data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",
cache:!1,
success:function(data) {
if(data) {
jQuery('#postviews_lscwp').html(data+' views');
}
}
});
but this code closely connected with LiteSpeed Cache plugin params.
I need more universal solution, that I can use with Cache Enabler plugin.
I will appreciate if you adivse me some solution or snippet.
I installed wp-postviews on site with Cache Enabler plugin activated. Using standard, not async code provided in Readme <?php if(function_exists('the_views')) { the_views(); } ?> caused common problem with not updating current views (as I expected - this page is rendered and written to cache).
The only way for now is to clear cache manually and decrease cache lifetime. But I can see that you provided some async code using JS and LiteSpeed Cache:
jQuery.ajax({ type:"GET", url:viewsCacheL10n.admin_ajax_url, data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews", cache:!1, success:function(data) { if(data) { jQuery('#postviews_lscwp').html(data+' views'); } } });
but this code closely connected with LiteSpeed Cache plugin params. I need more universal solution, that I can use with Cache Enabler plugin. I will appreciate if you adivse me some solution or snippet.