Performance, Caching and admin-ajax

Posted in: Newspaper
Post count: 104

So we’re trying to tweak performance after a long dialogue with our managed wordpress host (Synthesis). I hadn’t appreciated quite how much of a performance hit the theme can take on a server if all the “cool” bits of functionality are activated. We were starting to have 3 – 5 mini (60-120 seconds) outages on the site every day.

The main issue seems to be the number of times admin-ajax is hit on the server – we’re being told it’s thousands of times per day and after a bit of research on this forum and the latest (v1.5) of the theme we see there is quite a hit on numerous elements. So far we’ve done the following:

– Enabled Optimized ajax pre-loading on Mega Menu and the few blocks on the homepage that have ajax filters
– Disabled post view count
– Disabled comment count
– Disabled related content (replaced with Jetpack Related Content that offloads that to another server)
– Disabled more articles box

We’re going to monitor performance from here and see how it goes but wanted to see what other elements folk here would suggest monitoring and possibly disabling? Main next culprit would be Ajax View Count but i’m concerned about caching causing wrong pageview counts (although with the post view count disabled the only thing this would power now would be the trending now box on the homepage and the popular this week list in the footer).

Thoughts?

Post count: 104

Interestingly after disabling “Show Post View Count” it disabled that on the backend admin interface as well. Is this functionality binary (i.e. it is either on or off?) – wouldn’t it make sense to continue to log number of post views in the backend even if you decide not to show it off on the frontend?

Post count: 322

Check out the Heartbeat Control plugin in the repo – set it to only work on post and page pages (on the backend for auto-save and such) and set it to 60 seconds (max); it’ll bring the admin_ajax.php issue down drastically, even with post and comment counts going. It hasn’t been updated in 3 months but works perfectly on WP 4.3 with latest theme; it’s not very version dependent.

Here’s a link: https://wordpress.org/plugins/heartbeat-control/

Hope that helps you out. Worked wonders for me when I was still on shared hosting, and better now.

Post count: 104

Bryson – thanks for that. Question though if you stop heartbeat from working apart from the backend doesn’t it break the post and comment count functionality?

Post count: 322

It may have effects on that functionality but nothing that I’ve been able to find. I don’t believe the Heartbeat API is used by Newspaper for those features on the front end since my installation (Newspaper and NewsMag before that) had no issues. The plugin I mentioned doesn’t stop Heartbeat from working but it does reduce the numerous needless calls that WP makes to it in a lot of cases. Sort of depends on what other plugins you use but you really just have to try it out and see if another plugin’s admin settings/controls stop working… that’s the most likely scenario though I haven’t found yet.

Post count: 156

This plugs looks very nice, thanks for sharing:)

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.