Home Experience & Tips Sharing Standard Post

Standard Post

Method to Fix the gtmetrix Prompt "Specify a Vary: Accept-Encoding header" Error

Today, when testing the score of Naibabiji with gtmetrix, I got the prompt "Specify a Vary: Accept-Encoding header." After searching for information, I found that you just need to add gzip_vary on to your server configuration file. Specific fix method: If your server uses N...

Posted on January 17, 2020 About 1 minute read
修复gtmetrix提示Specify a Vary: Accept-Encoding header错误的方法

Today, when usinggtmetrix to test the scoreit prompted "Specify a Vary: Accept-Encoding header". After searching for information, it only requires adding gzip_vary on to your server configuration file.

Specify a Vary: Accept-Encoding Header

Specific fix method:

If your server uses Nginx, open your website's nginx configuration file and then addgzip_vary on;.

If you are using Apache, add the following code to the .htaccess file.

<IfModule mod_headers.c>
<FilesMatch ".(js|css|xml|gz|html)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>

Actually, from the screenshot, the file seen is the one Naiba uses for CDN acceleration. Gzip acceleration is enabled on the CDN, but for some reason, it doesn't carry the Vary: Accept-Encoding information. Since it can reach 91 points, we won't delve deeper into it.

Rate this article post
Previous How to Disable Gravatar or Cache and Accelerate Gravatar Avatars in WordPress Continue reading content around the same timeline. Next How to Modify When Uploading a Plugin on Shared Hosting Prompts Exceeding php.ini Size Limit View the next related tutorial or experience.

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: