maxcache и популярные записи

Проблема в том что просмотры страниц начинают подсчитыватся только когда я сброшу кеш, вопрос как это исправить ?
плагин кеша maxcache

код для funcion

function setPostViews($postID) {
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        $count = 0;
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
    }else{
        $count++;
        update_post_meta($postID, $count_key, $count);
    }
}
function getPostViews($postID){
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
        return "0";
    }
    return $count;
}

для singl

<!--?php setPostViews(get_the_ID()); ?-->

сталкивался кто с таким ?

Anonymous
Отправить
Ответ на: