Hi @emanuelsecurityweek,
There’s an entire section dedicated to Performance in the wiki, if you haven’t checked it out yet then it might be a good idea to do so as it contains all of the suggestions / recommendations that can be provided in that regard.
Anyways, when you enable data caching all SELECT database queries generated by WPP, including the ones from the endpoint you mentioned, are cached. REST API endpoints “lacking” in performance even with data caching enabled points to more general performance related issues on your site and not something solely caused by the plugin.
Thread Starter
emanuelsw
(@emanuelsecurityweek)
What would be a good value for the data sampling for a website with 25,000 articles and 670,000 view in the last 28 days?
I’d say a sampling rate around 250 should be fine. Test for a few days and adjust if needed.
Also, for such a big site I highly recommend using Redis / Memcached (if you aren’t using any of those already.)
Also, if you don’t plan on using old views data (eg. views data from 6 months ago) you may want to consider limiting the amount of data WPP stores on your database.
Thread Starter
emanuelsw
(@emanuelsecurityweek)
Hosting my website with WP Engine and they confirmed Memcached is available.
Enable it for 24 hours and see absolutely no difference in the performance.
The only thing different was in the Stats pages the number of views decreased by 90%
I still get an insane amount of calls to /wp-json/wordpress-popular-posts/v2/widget like 210k requests in 7 days.
My settings are, cache enabled, sampling of 250, data retention 21 days.
I still get an insane amount of calls to /wp-json/wordpress-popular-posts/v2/widget like 210k requests in 7 days.
The /v2/widget endpoint returns the popular posts list that’s rendered on your site so these amount of requests seem to be expected for your traffic numbers. The Data Sampling stuff has nothing to do with this.
Hosting my website with WP Engine and they confirmed Memcached is available.
In that case I recommend enabling the Pageviews cache feature, if you haven’t done so of course.