wp-server-timing icon indicating copy to clipboard operation
wp-server-timing copied to clipboard

More details about server timing sections

Open aminjabari opened this issue 2 years ago • 1 comments

Hi I just used your plugin to diagnose server response time issue.

In my case, template processing is the most problematic area (2.9 s of total 4s). Could you elaborate more about this section? How can I reduce the time spend in this section? Just replace the theme? is there any other solutions?

Thank you.

aminjabari avatar Apr 17 '22 13:04 aminjabari

Hi @aminjabari! Usually it means that you did not separated the business logic from the presentation and in your (for example front-page.php) template file. So you do all the db related logic and filtering the data there instead of functions.php.

What you can do is check the db queries: maybe they can be simplified with a plain sql query. Check for sorting and filtering logic in the php: most of the time, they can be moved to the db query. Check for file related activities: some themes load SVG images via file_get_contents which results in increased server response time. Also you can use WP Rocket or other caching plugin wich will basically zero out this section, because they will serve pre-generated static HTML files instead of processing the template in real time.

ocReaper avatar Apr 29 '22 07:04 ocReaper