PageSpeed Console
About the Console
The PageSpeed Console reports various problems your installation has that can
lead to sub-optimal performance. The console graphs metrics for these
problems over time so that you can see the result of your changes
improving or degrading your performance. You can view it by enabling it and
then visiting /pagespeed_admin/console
from your server. The
console works by saving snapshots of the statistics reported by
PageSpeed and then using the Google Chart Tools API to graph those
statistics over time.
Configuring the Console
The PageSpeed Console is configured with several directives in the configuration file. See PageSpeed Installation and Configuration for details about this file. Each of these directives is explained here.
-
Statistics
must be enabled to report statistics. -
StatisticsLogging
must be enabled so that graphs of statistics over time can be drawn in the console. -
LogDir
must be set so that we have a directory to store statistic logs. -
In order to access the console, you must set a handler appropriately.
For example, to make the console only accessible from localhost:
- Apache:
ModPagespeedStatistics on ModPagespeedStatisticsLogging on ModPagespeedLogDir /var/log/pagespeed <Location /pagespeed_admin> Order allow,deny Allow from localhost Allow from 127.0.0.1 SetHandler pagespeed_admin </Location>
- Nginx:
pagespeed Statistics on; pagespeed StatisticsLogging on; pagespeed LogDir /var/log/pagespeed; pagespeed AdminPath /pagespeed_admin; location ~ ^/pagespeed_admin { allow 127.0.0.1; deny all; }
Additionally these optional parameters may be configured:
-
StatisticsLoggingIntervalMs
may be set to indicate how often to log statistics snapshots (in milliseconds). -
StatisticsLoggingMaxFileSizeKb
may be set to indicate the maximum size for the logfile (in kilobytes).
For example, to log once a minute with a maximum log size of 1 MB:
- Apache:
ModPagespeedStatisticsLoggingIntervalMs 60000 ModPagespeedStatisticsLoggingMaxFileSizeKb 1024
- Nginx:
pagespeed StatisticsLoggingIntervalMs 60000; pagespeed StatisticsLoggingMaxFileSizeKb 1024;
Accessing the Console
The console can be accessed by browsing to
http://your.example.com/pagespeed_admin/console
. Access to
this page can be controlled using standard access directives.
Note that if you would like to access the console from machines other
than your server, you will need to allow access to
/pagespeed_admin
.
Graphed metrics
The PageSpeed console displays graphs for these metrics:- Resources not loaded because of fetch failures: Images, CSS or JavaScript could not be loaded because backend HTTP fetch failed. Remedy: You may have to reconfigure your server to allow outgoing connections or to have access to DNS.
-
Resources not rewritten because of restrictive Cache-Control headers:
Resources could not be rewritten because they had restrictive Cache-Control
headers explicitly set (for example:
Cache-Control: private
,Cache-Control: max-age=0
orCache-Control: no-transform
). Remedy: Reconfigure your server to serve these resources with public caching headers (or no Cache-Control headers at all). For example,Header set Cache-Control "max-age=600"
in Apache config. - Cache misses: Resources were not rewritten because they were not found in cache. This is expected while your cache warms up, soon after you install, however if it continues to be high, your cache is probably too small. Remedy: Increase the FileCacheSizeKb to be about 5 times as large as your website content (to store all of the original resources and various versions of rewritten resources).
-
Cache lookups that were expired:
Although these resources were found in cache, they were not rewritten
because they were older than their max-age.
Remedy: (A) Enable
LoadFromFile to tell
the server to load the files straight from disk rather than through
HTTP. (B) Reconfigure your server to serve resources with longer TTL.
For example,
Header set Cache-Control "max-age=3600"
to set one hour TTL in Apache config. - CSS files not rewritten because of parse errors: CSS files could not be rewritten because our parser found syntax errors that it could not recover from. Remedy: Fix CSS files to use proper syntax. You can use the stand-alone css_minify_main to find what part of the CSS file has parse errors. We have had some problems in the past with valid CSS3 or proprietary CSS extensions causing CSS parsing errors. If you find that your valid CSS is failing to parse, let us know on our discussion group so we can fix the parser.
- JavaScript minification failures: JavaScript files could not be minified because our parser found some syntax problem that it could not recover from. This is very uncommon. Remedy: As with CSS, fix the JavaScript files that had problems.
-
Image rewrite failures:
Image files were not rewritten for various reasons:
image_norewrites_high_resolution
: Image was too large. Currently we only rewrite images below 8 Megapixels. Remedy: Resize original images to a reasonable size.image_rewrites_dropped_decode_failure
: Image could not be parsed by our code. Remedy: Fix malformed images.image_rewrites_dropped_due_to_load
: Image was not rewritten because your system was already busy rewriting other images. This generally can happen when you first install PageSpeed while the cache warms up. Remedy: If image rewrites continue to be dropped after a day or so, you may need to increase your cache size or increase the ImageMaxRewritesAtOnce.image_rewrites_dropped_mime_type_unknown
: Image could not be rewritten because we do not recognize its MIME-type. For example, we do not parseimage/x-icon
orimage/svg+xml
. Remedy: Convert your images to a type that we understand (gif, png, jpg, webp) or perhaps just fix a broken server config that is serving images with a bogusContent-Type
header.image_rewrites_dropped_server_write_fail
: Unexpected server error while rewriting images. If you get a significant number of these write to our discussion group so we can investigate.