Hi,
we obverse a heavy performance degregation when browser language detection is switched on by 30-40%.
We observe the following:
1. Google page speed analysis labels …browser-redirect/app.js containing outdated javascript. Are you planning to modernise this script?
2. …browser-redirect/app.js is as heavy as our main js fail run ALL javascript of the site. Could you help us to understand how one feature such as browser language detection can take up that much space?
3. It seems that the language detection does not happen at the very beginning of the page load but much later. Is there any way to optimize this?
4. We are confused about this issue and wonder whether different themes might handle this differently. Glad if you could share your experience with this.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+01:00)
Hi Felix,
We’re aware that Google flags this as outdated JavaScript and reports a performance penalty of approximately 36 KB. However, please note that this is legacy JavaScript, including older Babel transforms and certain polyfills (such as Array.from, Array.flat, Promise.any, Object.assign, Reflect.*, and various String.prototype methods), which are required to maintain compatibility with older browsers.
I’ve raised this with our development team to review whether any optimizations are possible without compromising browser support.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+01:00)
There are no reports of this issue so far (point 2). The first step would be to provide a staging environment where the issue can be reproduced in isolation. This will allow us to determine whether your code might be causing a combination of errors (which will also answer point 3+4)
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+01:00)
Hi,
Thank you for granting access. I can see that the redirect is currently active. However, I’m not sure how to reproduce the issue you described in point 2:
2. …browser-redirect/app.js is as heavy as our main js fail run ALL javascript of the site.
Could you please let me know where exactly I can reproduce this issue? Is there a specific page, function, or example I should check to see how app.js is affecting other JavaScript on the site?
many thanks for your response. As per screenshot attached from google page speed, you can see that the wpml redirect javascript file has the same size as the javascript libarary of our front end containing als feature and is significantly bigger than the jquery library. In my perpective, the redirection javascript should be significantly smaller than those other files?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+01:00)
Hi Jona,
this seems OK. The original file in filesystem is 170kb. Please keep in mind that the file itself is a minified 3rd party library. However, I will share this too with our team.