Hello @dimelevov
Thank you for reaching out and I am happy to help!
You can always exclude specific page from being cached by adding the URi to Performance>Page Cache>Advanced>Never Cache following pages: field, for example: /some-page/
You can allso add a constants to specific template:
define(‘DONOTCACHEPAGE’, true);
Let me know if this helps!
Thanks!
Hello @vmarko
Thank you for your answer.
But what if I use WP widget with php code where I call php function which retun the user country based on user location and it work good when I use it directly in php file, but here in the widget it is cached.
If I disable the page cache, it works fine. However, with the page cache active (Disk: Enhanced), I see an incorrect location. This likely occurs with the first user who arrives after the page cache is activated or purged.
The same is happning and with $_SERVER[“HTTP_CF_IPCOUNTRY”]
Thanks
Hi,
I have also added a custom post views counter function that I invoke on single.php, and it works only the first time if the page cache is enabled.
function set_post_view() {
$key = 'post_views_count';
$post_id = get_the_ID();
$count = (int) get_post_meta($post_id, $key, true);
$count++;
update_post_meta($post_id, $key, $count);
}
Strange…
We have very good result with page cache that is reason why I want to have enabled.
Thanks
Hello @dimelevov
Thank you for your feedback.
In this case, you can use Page Fragment Cache and use the mfunc and mclude comments as a replacement of the PHP tags
I hope this helps!
Thanks!