Reduce initial server response time

Server response time (also known as Time To First Byte) measures how long it takes the first byte of HTML to get from your server to your visitor’s browser. 

The faster the server responds, the faster the visitor will start seeing your page load.

PageSpeed shows this recommendation if the response time is more than 600ms.

How WP Rocket can help

Caching

Page caching greatly reduces the server response time by serving fast HTML pages, instead of slow, PHP-generated pages. 

Serving the cache file via our rewrite rules in the .htaccess file is the most optimal method.

Here are some relevant recommendations:

  • NGINX: If your site is running on a standalone NGINX server, without an .htaccess file, you can implement this configuration to achieve the same optimal method to serve the cache: https://github.com/SatelliteWP/rocket-nginx.
  • Mobile cache: The rewrite rules are replaced by a PHP-based device detection to properly serve the cache-specific files. So, you could disable the mobile-specific cache to deliver the default (desktop) cache to mobile visitors using the rewrite rules directly.

    In WP Rocket versions older than 3.16, you can disable Separate cache files for mobile devices feature.

    Note: This approach may not be totally recommended if you have mobile-specific content in your site.
  • WebP Compatibility: This option removes the rewrite rules to detect if the browser is WebP compatible and serve the WebP cache. Disabling this option, and serving the WebP from your image optimization plugin instead, may help.
  • Plugins with mandatory and dynamic cookies: The usage of these plugins, removes the rewrite rules to make the PHP-based cookie detection. So, if possible, switching to an AJAX-based approach.

Important! The above recommendations are not mandatory, and don't apply to all cases. Most servers should be able to quickly process PHP while keeping the mobile-specific cache, WebP Compatibility, and cookie-based plugins.

Database optimization

A bloated database can affect TTFB. Try using our database optimization feature to reduce the size of your database, and running regular cleanups.

You’ll find this feature under Dashboard > WP Rocket > Settings > Database

GZIP compression

WP Rocket applies this  automatically when a site runs on Apache/LiteSpeed. Compression reduces the filesize of the HTML making it faster to download. More info

Caching is working but I still see the recommendation

This means there are additional factors, outside of WP Rocket’s control, that are  affecting the server response time. 

Hosting / server resources

Your site can only be as fast as your hosting allows. 

If you are using a shared/cheap host, it means that your site is sharing resources with others on the same server. This affects how fast your site can run, even with caching. 

If you are seeing a server response time that varies a lot from test to test, or is consistently high, even when caching is active, this can indicate underlying issues with the server.

Upgrading your hosting package, or if you’re on a VPS, allocating more resources, will help.

PHP

Use the latest version of PHP available to you. 

If you are still on PHP 5.6, moving to 7+ is a must.

Geography

The distance between your server and your visitors will impact the server response time, and time to first byte. 

If your site is targeted to a specific geographic region, find a host that can host your site on a server close to your target audience.

Cloudflare Cache Everything

If you are a Cloudflare user, activating their Cache Everything feature will help by caching the HTML itself on their CDN, thereby improving the initial response time. 

Make sure to activate the Cloudflare Add-On in WP Rocket for full compatibility.

Code bottlenecks

Plugins, or other code on your site that is running slowly or generating errors can tie up your server’s resources so that it won’t be able to respond as quickly. 

Use a plugin like Query Monitor, or if it’s available to you, a service like New Relic, to see if there are any code issues on your site.

LazyLoad for CSS background images feature

Having the LazyLoad for CSS background images option enabled can cause a high server response time on pages that are not cached yet since this feature has to process all the CSS in your pages. This shouldn't affect pages that are already cached.

Additional resources

Not a WP Rocket customer yet?
Read our article about How to Reduce Time to First Byte and learn how to address this PageSpeed Insights recommendation with and without a plugin.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.