-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Redirecting to non-amp version for some reason. #1369
Comments
@jukefr The redirection is happening because there are unaccepted validation errors, as you note. So when accessing the But you're saying that when you click “Re-validate” it fails with a timeout error. There's nothing in the debug log because the error is right there, a timeout. What I suggest to try is to increase the timeout for the AMP validation loop requests by putting code like the following in your custom theme's // Increase timeout for AMP validation requests from 15 to 60 seconds.
add_filter( 'http_request_args', function( $args, $url ) {
$query = wp_parse_args( wp_parse_url( $url, PHP_URL_QUERY ) );
if ( isset( $query['amp_validate'] ) ) {
$args['timeout'] = 60;
}
return $args;
}, 10, 2 ); Issues related to timeout were previously explored in #1166, where the timeout was increased from 5 seconds to 15 seconds by default. I'm curious how quickly pages are being generated in other cases:
The two latter points each involve extra overhead not incurred by the previous two steps. You can manually perform the last step in your browser by making a request with |
I'm closing this in favor of your other ticket since it's really the same issue. |
What I did :
When I visit an AMP page via the admin menu or direct link I get directed to
/?amp
then/?amp-validation-errors-xx
and this redirects me to/
which means I cannot reach the AMP page.If I activate the
Automatically accept sanitization for any AMP validation error that is encountered.
option then the?amp
will work, and not redirect me to/
.No logs regarding this problem appear in my debug.log so I cannot help much more.
The text was updated successfully, but these errors were encountered: