How to change cache duration

[ad_1]

You can use a code snippet that you would add to a functionality plugin on your site. In that code snippet, you would define a number of seconds for the cache duration (it is set to 3600 seconds, i.e. an hour, by default). In the example below, I’ve changed the duration to 2 hours:

add_filter( 'jp_post_views_cache_duration', function () { return 7200; } );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer