volteq Posted June 6 Share Posted June 6 we recently upgraded to CC6.5.1 and are really pleased about the result. when we enabled the reCaptcha, we found it adding quite some extra time to significantly impacted the google core vitals. I was wondering if there are ways to get around it? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6 Share Posted June 6 Turn it off? Quote Link to comment Share on other sites More sharing options...
volteq Posted June 8 Author Share Posted June 8 that's what we did now. however, we get a ton of spammers leaving feedback, so it will be nice if there is a way to turn it on without too much of a performance haircut. Quote Link to comment Share on other sites More sharing options...
macgillivray Posted July 19 Share Posted July 19 Is there any way to get the recaptcha script to load after the main website content? Google script seems to be a drain on resources as well as being helpful! Thanks! Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 19 Share Posted July 19 Please examine the templates 'content.recaptcha.head.php', content.recaptcha.php', and element.recaptcha.php'. These templates call the recaptcha script, and the <script src=""> tag should have async defer in it. That should cause the browser to continue loading the HTML and rendering it without waiting for the script to finish loading. (Nor does the script wait for the HTML to finish loading.) Quote Link to comment Share on other sites More sharing options...
macgillivray Posted July 19 Share Posted July 19 Thanks - the first two files mentioned contain the async defer; the third - element.recaptcha.php doesn't seem to exist in the currrent template folder for foundation skin. the file listed is element.recaptcha.invisible.php which apparently is left intentionally blank. It's a bit of a mystery, then because the recaptcha is mentioned in the speed check on pagespeed.web.dev for the mobile and the desktop site ... Thanks for replying, Brian - much appreciated, Margaret. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 20 Share Posted July 20 (edited) Sorry, 'element.recaptcha.php' is new to CubeCart v6.5.2 (not yet released). So, I am thinking that, even though the script tag in the template has async defer, which allows the script to run without waiting for the HTML to finish, the script that gets fetched then constructs a new piece of the web page and loads another script - what seems to be that /recaptcha__en.js filename. The keywords async and defer do not need both to be used. Some say that async will be used, but if the browser is old enough to not support it, then the fallback is to use defer. In those files I mentioned, you can try to have only defer. (You may need to have CubeCart clear its internal cache if you make changes to the templates.) See: https://pagespeedchecklist.com/async-and-defer Edited July 20 by bsmither Quote Link to comment Share on other sites More sharing options...
macgillivray Posted July 20 Share Posted July 20 Thanks, Brian - I'll try this now and see what happens. Will report back. Margaret Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.