• Resolved GermanKiwi

    (@germankiwi)


    Hi, I recently found these three lines at the bottom of my htaccess file:

    #SGO Unset Vary
      Header unset Vary
    #SGO Unset Vary END

    One of SiteGround’s tech support team told me this:

    “this rule was added in the release of last January in order to remove the Vary:User-Agent header from the site in order to improve the caching ratio. Often the Vary:User-Agent header is added without any need, which causes problems with us. In case it is needed, it can be enabled in the Browser-Specific Caching option in the SG Optimizer interface.”

    In my testing, I found that if I enable “Browser-Specific Caching” in the SG Optimizer interface, then it removes the “unset Vary” entry altogether, and nothing else is added. Specifically, the “Vary:User-Agent” header is *not* added.

    But if I disable “Browser-Specific Caching” in the SG Optimizer interface, then it adds the “unset Vary” entry.

    This appears to contradict what the tech support team told me. They told me that disabling this setting would result in the “Vary:User-Agent” header being added to my htaccess.

    In any case, I would like to understand why the “unset Vary” entry is added when I disable Browser-Specific Caching.

    Because your article at https://www.siteground.com/blog/vary-http-header/ states that the Vary header should be set to “Accept-Encoding” for best results. So why is the plugin disabling this heading completely? Shouldn’t it just set it to “Accept-Encoding”?

    • This topic was modified 3 years, 7 months ago by GermanKiwi.
    • This topic was modified 3 years, 7 months ago by GermanKiwi.
Viewing 1 replies (of 1 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Generally, unless you have a very speciffic requirements for Vary: User-Agent you don’t need either. The Accept-Encoding part handles the Gzip, Brotli, etc. encoding support. Since our NGINX is properly configured, there is no need for that header either. So we unset them altogether.

Viewing 1 replies (of 1 total)
  • The topic ‘SG adds “Header Unset Vary”’ is closed to new replies.