livechat/chat-widget-adapters

Optimize external scripts

dmke opened this issue · 2 comments

dmke commented

Is your feature request related to a problem? Please describe.

Embedding the LC widget leads to a large PageSpeed performance degradation.

https://pagespeed.web.dev/report?url=https%253A%252F%252Fwww.intervillas-florida.com%252F&hl=en&form_factor=mobile

Reduce unused JavaScript

Ignore the Facebook/Instagram chunk.

image

Reduce the impact of third-party code — Third-party code blocked the main thread for 610 ms

image

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

  1. 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).
  2. 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 👋 thanks for the report.

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 🙂 Unfortunately as this issue is not directly related to the Chat widget Adapters project I am going to close it for now. Feel free to leave any additional questions or contact us via LiveChat Community or our support directly if have any more questions related to the Product itself.