Title: Random Recent Topics Widgets – Disable AJAX Loading for Better Performance
Hello,
I am using approximately 10–12 Recent Topics widgets with random sorting across multiple forum boards. These widgets are extremely valuable for internal linking, SEO and visitor engagement.
However, following an extensive investigation into CPU spikes on my dedicated server, I discovered that these widgets generate a considerable number of separate AJAX requests, even when the main page is fully cached.
Some findings:
-
Approximately 102 WPForo AJAX requests per minute.
-
Individual widget requests sometimes take 6–12 seconds.
-
PHP-FPM periodically consumes 100% of available CPU capacity.
-
The AJAX action is
wpforo_load_ajax_widget_RecentTopics.
My website currently receives approximately 600,000 page views per month, so the additional server workload is substantial.
Is there a setting, PHP filter or code snippet that would allow the Recent Topics widgets to be rendered directly into the page HTML, rather than being loaded separately through AJAX?
This would allow WP-Optimize to cache the widget output together with the rest of the page.
I have absolutely no objection to the random topics remaining unchanged until the page cache is regenerated.
Ideally, I would like to retain all existing widget functionality, including random sorting and multiple forum board support, while eliminating the separate AJAX requests.
All my widgets already have the Auto Refresh Interval set to 0. However, each widget still generates a separate AJAX request upon the initial page load. What I would like to disable is the initial AJAX loading, not the automatic refresh, which is already disabled.
Thank you!
Lucky