Created
January 12, 2023 11:49
-
-
Save maheshwaghmare/247d6f16c7b462d577d09986faa1f323 to your computer and use it in GitHub Desktop.
Increase the page speed request timeout from 30 seconds to 90 seconds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'http_request_args', 'prefix_http_request_args', 10, 2 ); | |
function prefix_http_request_args( $parsed_args, $url ) { | |
if ( false === strpos( $url, 'runPagespeed' ) ) { | |
return $parsed_args; | |
} | |
// Set timeout with 90 seconds. | |
$parsed_args['timeout'] = 90; | |
return $parsed_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment