Today, while using
gtmetrix test scoreit prompted "Specify a Vary: Accept-Encoding header." After searching for information, I found that simply adding `gzip_vary on;` to the server configuration file resolves it.
Specific Fix Method:If your server uses Nginx, open your website's nginx configuration file and add
gzip_vary on;If you are using Apache, add the following code to the .htaccess file.
Header append Vary: Accept-Encoding
Actually, from the screenshot, the file shown is from the CDN acceleration used by Naiba. The CDN has gzip acceleration enabled, but for some reason, it doesn't include the Vary: Accept-Encoding header. Since it reached 91 points, I won't delve deeper into it.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.