Optimize external scripts
dmke opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
Embedding the LC widget leads to a large PageSpeed performance degradation.
Describe the solution you'd like
As you can see, the external resources are huge, and block the rendering for the page for up to half a second.
Without the LC widget, the PageSpeed ranks in the mid-80s.
It would be nice if you could spare some engineering time and improve this situation.
(I realize this has not much to do with the adapters provided in this repository, but I'd like to keep the discussion open for others stumbling on this issue.)
Describe alternatives you've considered
- I've considered to delay loading the chat widget. This however only moves the problem to a later point in time (and maybe hide it from the PageSpeed tools).
- Disable the LC integration altogether. This isn't really an option :)
Additional context
We're using the Vue 2 adapter:
Code
Localization and session variables omitted for brevity.
<template>
<div>
<a
v-if="!isReady"
:href="`https://direct.lc.chat/${license}/1`"
rel="nofollow"
target="_blank"
>Chat with us!</a>
<LiveChatWidget
:license="license"
@ready="isReady = true"
></LiveChatWidget>
</div>
</template>
<script>
import { LiveChatWidget } from "@livechat/widget-vue/v2"
export default {
components: {
LiveChatWidget,
},
props: {
license: { type: String, required: true },
},
data() {
return {
isReady: false,
}
},
}
</script>
We're pretty much experiencing the same problem as @dmke described above. This isn't new though. You can find other concerns like this in the articles like this and the official reply by LiveChat team is here.
It would still be good to know if there is something else team is trying to do about it since this is what is bothering a lot of LiveChat customers.
Hello @dmke
We are aware of the impact that our Chat Widget application might have on our client's website performance. We do our best to minimize the impact, including properly loading the scripts as a non-blocking asynchronous one, reducing the initial load for minimized widgets until it's being maximized using code splitting, and more. We just cannot weigh 0KB.
There is a detailed explanation here in this article: https://www.livechat.com/help/is-livechat-slowing-my-website/.
As mentioned in the article we fight an unfair battle with tools that commonly misinterpret our script loading as an important part of the website unnecessarily counting them to metrics loading time.
I can assure you we are constantly optimizing things that we found that can be optimized further