Search code examples
cors

Issue with CORS, ChunkLoadError | Live Helper Chat


I use Live Helper Chat in my websites. In those day I need configure CORS to allow the widget only on my domains because someone stole the chat code from my website and pasted in in a busy website not mine.

Now I have the following issue: moving from peopleinside.it to helpdesk.peopleinside.it will cause the widget to not been showed on the new page.

Video: https://app.screencast.com/KmUBntkIAnvUV

If I open developers tools with the settings to not store cache then reload the page the widget is again visible.

The issue is present also if I move from helpdesk.peopleinside.it to peopleinside.it

Seems one of the error are ChunkLoadError

Any suggestion on how I can resolve this issue? https://github.com/orgs/LiveHelperChat/discussions/2000

I don't know what I can do for resolve this issue. I don't know what try to resolve this.


Solution

  • I found the solution. The issue was somethin was cached.

    Added to the .htaccess file the following code

    # DISABLE CACHING
    <IfModule mod_headers.c>
        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires 0
    </IfModule>
    
    <FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
        <IfModule mod_expires.c>
            ExpiresActive Off
        </IfModule>
        <IfModule mod_headers.c>
            FileETag None
            Header unset ETag
            Header unset Pragma
            Header unset Cache-Control
            Header unset Last-Modified
            Header set Pragma "no-cache"
            Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
            Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
        </IfModule>
    </FilesMatch>
    

    This resolved the