• Resolved Naweed Chougle

    (@hypersonic)


    I’ve switched ON Site Stats, and am using stats_get_csv to retrieve the 3 most popular posts/pages of the last 15 days using the following code:

    if(function_exists('stats_get_csv')):
            $popular = stats_get_csv( 'postviews', array( 'days' => 15, 'limit' => 3) );

    My question is, do we need to limit the number of times this API call can be made?

    I am thinking to cache the result for half a day, since the repeated API calls will be unnecessary.

    What is the right way to cache the $popular results?

    Thanks.

    https://www.ads-software.com/plugins/jetpack/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Avoiding overuse of stats_get_csv’ is closed to new replies.