magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

[Performance] Load reCaptcha on focus to input to improve page load times

Open Bashev opened this issue 1 year ago • 6 comments

Description

If reCaptcha is enabled, this few additional JS files are loaded automatically with the page loading. This reflects to the page speed of the site and of course, increase time to complete loading.

These files are external for the system and this also reflects to pagesspeed. They cannot be merged or bundled. This are 26 additional requests which comes with recaptcha loading.

image

Expected behavior

Load recaptcha related files (and entire library) to be loaded only if is required and have forms to which need to be applied.

Benefits

Reduce loading time, increase page speed of the site (Google Page Speed).

Additional information

No response

Release note

No response

Bashev avatar Dec 19 '23 14:12 Bashev

Hi @Bashev. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar Dec 19 '23 14:12 m2-assistant[bot]

@magento i am working on this

Bashev avatar Dec 19 '23 14:12 Bashev

Fixed in https://github.com/magento/security-package/pull/334

Bashev avatar Dec 19 '23 14:12 Bashev

Before image

After image

Bashev avatar Dec 19 '23 19:12 Bashev

Re invisible reCaptcha v3 - the way this technology works is it tracks the user behaviour through the website to establish if it is real user or a bot. It is supposed to be included on all pages, not loaded after a form is interacted with, see documentation - https://developers.google.com/recaptcha/docs/v3

techtoni avatar Dec 21 '23 11:12 techtoni

@engcom-Hotel you move it to feature request backlog, but it's already fixed with this PR (in security package) https://github.com/magento/security-package/pull/334

How can be moved forward?

Bashev avatar Aug 29 '24 11:08 Bashev

Hello @Bashev,

I think it is due to the migration of the project from the classic to the new one. Don't worry whenever your PR will merged we will close this issue.

Thanks

engcom-Hotel avatar Aug 30 '24 09:08 engcom-Hotel