Unable to Fetch Page Speed Results in W3 Total Cache

»»»Unable to Fetch Page Speed Results in W3 Total Cache

After configuring the Page Speed API Key in W3 Total Cache plugin in order to retrieve and view Google Page Speed Report from within the WordPress dashboard, the following error message is displayed in Google Page Speed dashboard widget:

Unable to fetch Page Speed results.

Unable to fetch Page Speed results.

The error normally happens when PageSpeed Insights API key is set to have key restriction based on HTTP referrers (web sites). When the Google API key is blocked from been used by incoming requests, the error ratio and error count shown on the Google API Manager console steadily increased with every refresh on the Google Page Speed Report widget.

As mentioned above, the cause for the “unable to fetch Page Speed results” error is most likely due to misconfiguration of API key restriction.

To resolve the issue, visit the Credentials of Google API Manager at https://console.developers.google.com/apis/credentials (make sure you select the project which the API key is used in W3TC).

Click or tap on the Edit (pencil) icon at the end of the API key. Under “Key restriction” section, select IP addresses (web servers, cron jobs, etc.), and then enter the IP addresses of web server that hosts the website and makes the Google PageSpeed requests to Google.

Google API Key Restriction

If for some reason you cannot set the key restriction to be based on IP addresses, you can try the following workaround. W3 Total Cache doesn’t seem to properly set the referrer in HTTP/HTTPS request header, and as the result, blocking by HTTP referrer is almost certainly to fail. To make it works, try to add the following line to HTTP referrers (web sites) option:

*.googleapis.com/*

The worst case scenario is to remove all key restriction by selecting None, but this workaround will make the API key unrestricted, which may accidentally expose the API key to unauthorized use and quota theft.

By | 2017-05-25T23:34:31+00:00 May 25th, 2017|Categories: Developer Tools|Tags: , , , |0 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.

Pin It on Pinterest

Share This

Share This

Share this post with your friends!