Introduction
When mod_pagespeed attempts to rewrite/optimize a resource for the first time, it must fetch it via HTTP. The fetcher is responsible for this task.
You may find that you'd like to more easily locate and diagnose problems that you encounter with the mod_pagespeed fetcher. By adding a custom value to the fetcher user agent, you can easily locate requests that have been made by the fetcher within the Apache access logs.
Procedure
1. Login to your server via SSH or Terminal as the root user
2. Open the main server-wide mod_pagespeed configuration file with your editor of choice. You can learn where this file is located in the following resource:
What are the configuration file locations for mod_pagespeed on a cPanel server?
3. Add the following configuration directive:
ModPagespeedCustomFetchHeader User-Agent myCustomUserAgentStringHere
4. Restart Apache so that it updates with the new configuration:
/scripts/restartsrv_apache --restart
5. You may not see any new fetcher requests until the caches have expired. When the caches have expired, you should eventually be able to search for the fetcher requests in the Apache logs with your custom user agent string like this:
grep -R myCustomUserAgentStringHere /etc/apache2/logs
Comments
0 comments
Article is closed for comments.