• Resolved Beyrone

    (@beyrone)


    I have connected this plugin with QUIC cloud and ever since Lighthouse is unable to give a score on “Best Practices”, it says:

    “A character encoding declaration is required. It can be done with a <meta> tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header.?Learn more.”

    I have a <meta charset=”UTF-8″> in the html head but Litespeed inserts a script tag above it (even though the wp_head() function comes after the charset):

    These are the contents of the script tag:
    var litespeed_docref=sessionStorage.getItem("litespeed_docref");litespeed_docref&&(Object.defineProperty(document,"referrer",{get:function(){return litespeed_docref}}),sessionStorage.removeItem("litespeed_docref"));

    I have a feeling it makes Lighthouse complain the charset is not in the first 1024 bytes?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support qtwrk

    (@qtwrk)

    interesting issue , I never seen this before

    a quick temp workaround

    add this to your .htaccess

    SetEnvIf Request_URI "/$" change_header
    Header set Content-Type "text/html; charset=utf-8" env=change_header

    my site has the code you post , but it passes this check , perhaps you have something else there

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter Beyrone

    (@beyrone)

    Thanks for your reply. I was using a tool called unlighthouse to scan multiple pages and this came up. But in the standard lighthouse tool it is not a problem, so I guess its ok.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lighthouse – Best Practices charset’ is closed to new replies.