I use Wordpress plugin: snippets to show some data in database. Everything is OK, however, when I change the content in the database. After that I refresh many time in the page. And the content is not change. I close the web page, and wait for 5 minutes. Reopen the page again, the content is updated. What happens in my situation? Please give me some suggestion!
In Snippets:
public function some_function() {
global $wpdb;
$results = $wpdb->get_var(
$wpdb->prepare("SELECT count(ID) as total FROM {$wpdb->prefix}sample_table")
);
return $results;
}
add_shortcode('sample_shortcode', 'some_function');
In the Page - I add the shortcode
[sample_shortcode]