google / recaptcha

PHP client library for reCAPTCHA, a free service to protect your website from spam and abuse.
http://www.google.com/recaptcha/
BSD 3-Clause "New" or "Revised" License
3.48k stars 777 forks source link

Recaptcha is requesting recaptcha__en.js file multiple times #236

Closed Rueff19 closed 6 years ago

Rueff19 commented 6 years ago

Hi there,

I was having this problem with one of my projects and to try to figure out what was wrong I decided to run the example code from recaptcha docs.

Even with this example code the page is still requesting the file multiple times.

Here is a jsFiddle with the example code: https://jsfiddle.net/7h7rnqbn/

Just open the network tab and see the file requests.

rowan-m commented 6 years ago

It looks like the widget itself re-uses the recaptcha__en.js file. In the network tab you should see different initiators for those requests.

sandeepsingh3 commented 6 years ago

what is the resolution for this issue ?

Rueff19 commented 6 years ago

@sandeepsingh3 Apparently there isn't one.... I waited for so long for a response that I moved on. After a month or two @rowan-m responded. He just stated what I already knew(that is the recaptcha widget that re-uses the file) and closed the issue.

jj-plane commented 5 years ago

I still get this issue.

briedis commented 5 years ago

Still getting the issue. Loading same files 3 times, and each is 250KB unzipped, which is quite a lot!

Malvoz commented 5 years ago

This issue may be resolved in https://github.com/google/recaptcha/issues/331.

andcha commented 4 years ago

@Malvoz No, this issue has not resolved yet. On one hand google pagespeed complains of reducing number of request and here recaptcha is unnecessarily adding an extra request for same file.

One request is being initiated by https://www.google.com/recaptcha/api.js and another by https://www.google.com/recaptcha/api2/anchor

If anyone finds any workaround to this mess then please post here.

alonseg commented 4 years ago

this Issue still bothers us and add significant 'drag' to our load time

lugus commented 4 years ago

same issue

Cooperdale commented 4 years ago

Same here. Very heavy issue, I'll probably get rid of recaptcha for the time being.

andcha commented 4 years ago

More than two years have passed and still no solution. What a disappointment this is turning out to be.

kenigbolo commented 4 years ago

Any updates to this? Might be good to get some insights if this would be fixed sometime soon or in the distant future

jazkh commented 4 years ago

@alonseg

this Issue still bothers us and add significant 'drag' to our load time

use explicit render method to avoid loading recaptcha during page load.

koubinhanz commented 4 years ago

@alonseg

this Issue still bothers us and add significant 'drag' to our load time

use explicit render method to avoid loading recaptcha during page load.

@jazkh have you treid that? with explicit render the issue is exactly the same. the file (exact content) is downloaded 3 times. I really don't understand this behavior from Google and their #perfmatters campaign. very disapointed here!

jbaris commented 4 years ago

I'm facing this issue. Any news?

milabron commented 4 years ago

Google imposes how to do things, but even they don't comply. In my village, this is called politics.

ThodorisElissaios commented 3 years ago

any news?

luiznasciment0 commented 3 years ago

+1 :(

Nodws commented 3 years ago

use another method, google says its not their problem

AndrejGajdos commented 3 years ago

Why was this issue closed?

lamka02sk commented 3 years ago

Google really seem to care about performance of our websites.

vgstef commented 2 years ago

We also have this issue. What can we do?

ansmlc commented 2 years ago

Have the same issue. It has a significant negative impact on performance of our sites. I guess we’ll have to look for alternative solutions. This is not worth it.

Malvoz commented 2 years ago

See https://github.com/google/recaptcha/issues/236#issuecomment-544536676.

sntgchns commented 1 year ago

c'mon! 50% of website performance is ruined by a script of the best company? Fix that s**t please!

https://www.gstatic.com/recaptcha/releases/0hCdE87LyjzAkFO5Ff-v7Hj1/recaptcha__en.js

loads 4 times in my case, the multiple script loads weights 4 times all my website images!!! image

luxaeter commented 10 months ago

any updates on this issue recaptcha js

arifje commented 8 months ago

Still having this issue, loaded 3 times:

Screenshot 2024-03-06 at 13 47 07

rajparekh07 commented 8 months ago

One crazy way to fix this -> Use service worker -> intercept if recaptcha_en.js -> cache it.

Next request -> serve from the cache.

Since I am sure the request is well versioned, it wouldnt be hard to bust the cache.