Skip to content

Using W3 Total Cache and GTmetrix to optimize WordPress

As your WordPress site grows in traffic and content, performance can slow down because WordPress must recompile pages for every visitor. By combining W3 Total Cache (for caching) with GTmetrix (for performance testing), you can significantly improve speed and efficiency on ruachost.com hosting.

  • W3 Total Cache → Adds caching functionality to WordPress, reducing server workload.
  • GTmetrix → Measures site performance and provides actionable recommendations.
  • Together, they help ensure faster page loads, better SEO, and improved user experience.
  1. Log in to WordPress as an administrator.
  2. Go to Plugins → Add New.
  3. Search for GTmetrix.
  4. Click Install Now, then Activate.
  5. In the sidebar, click GTmetrix.
  6. Obtain a free GTmetrix API Key at gtmetrix.com/api.
  7. Enter your account email and API key in the plugin settings.
  8. Save changes.

✅ You can now run performance tests directly from your WordPress dashboard.

  1. In WordPress, go to GTmetrix → Tests.
  2. Click Test your Front Page Now.
  3. Review the graded score and click Detailed Report for insights.
  4. Use the waterfall chart to identify slow resources.
  1. In WordPress, go to Plugins → Add New.

  2. Search for W3 Total Cache.

  3. Click Install Now, then Activate.

  4. Go to Performance → General Settings.

  5. Enable the following:

  6. Save all settings.

⚠️ If you see the error “The required directives for fancy permalinks could not be detected”, go to Settings → Permalinks, choose a non‑default option, and save changes.

  1. Clear the cache: Performance → Empty All Caches.
  2. Refresh your homepage a few times to generate initial cache.
  3. Run another GTmetrix test to confirm improved performance.
  • Memcached or Redis → If supported by your hosting plan, configure W3 Total Cache to use these for faster caching.

  • Expires Headers → Add directives in .htaccess to enable browser caching:

    ## EXPIRES CACHING ##
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    ## EXPIRES CACHING ##