Skip to content
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

Defer the loading recaptcha__en.js #39

Open
iWpress opened this issue Feb 29, 2024 · 2 comments
Open

Defer the loading recaptcha__en.js #39

iWpress opened this issue Feb 29, 2024 · 2 comments

Comments

@iWpress
Copy link

iWpress commented Feb 29, 2024

Hello,
I really like this package. I had no problems setting it up and using it. But lately, the download of the recaptcha__en.js script from www.gstatic.com is the slowest resource that affects my site speed the most. Is it possible to defer the loading of this script?
Best Regards.

@iWpress
Copy link
Author

iWpress commented Mar 4, 2024

Until the page is loaded and the user fills out the form, reCAPTCHA is not needed at all. This is exactly the situation when you need to defer loading.

The problem is that when you make changes to the initJs() method on:
return '<script async src=
or
return '<script defer src=
I get a notification: required: Please verify that you are not a robot

Although this is exactly what is recommended in Google's documentation: https://developers.google.com/recaptcha/docs/loading

@josiasmontag tell me, please, in which direction to look.

@iWpress
Copy link
Author

iWpress commented Mar 6, 2024

I started a discussion on the forum. So far, there is no good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant