Chapter in this post:
As many of you already know, I spend my dear, long day around customer websites that are usually based on WordPress. For this reason, today again a tip that I just learned myself when I checked the loading time of a website Tool from Pingdom controlled.
The website received the grade "A" (corresponds to school grade 1) everywhere, but a lonely "E" entry (school grade 5) with the message "Specify a Vary: Accept-Encoding Header". Incidentally, this message is not only available with the load time tool from Pingdom but also with other tests such as GTmetrix or Google PageSpeed Insights.
Basically, this message means that the server may be caching data, but isn't looking at the modern ones Browserthat support gzip compression actually get the compressed files. In the "worst" case, it could happen that an old browser is properly sent an uncompressed version of a file and this is cached on the server side. If a modern browser then comes by, it will also get the uncompressed data, which of course limits the performance when loading.
Inset - more interesting posts on the blog:
As always, my warning at this point: Before you work on the .htaccess file in the WordPress main directory, please make a backup. And only ever changes this file via FTP program. There are WordPress plugins that allow changes to be made in the file via the WP admin area, but if something goes wrong, WordPress and an editor are no longer available and the page remains white or throws an error. Then you can only undo the changes via the FTP program - and your website will be down for that time. So work on it right away via FTP.
In order to iron out the "error" with the "Specify a Vary: Accept-Encoding Header", enter the following lines of code at the end of your .htaccess file:
Header append Vary: Accept-Encoding
So it looks like this for me:
For you, however, it can look different, as you may not be using a security plug-in or caching plug-in that has already written additional things into this code. You can ignore that at this point.
After I ran the test at Pingdom again, there was now an "A" in the rating at the point where an "E" was previously to be found. Operation successful!
Jens has been running the blog since 2012. He appears as Sir Apfelot for his readers and helps them with problems of a technical nature. In his free time he drives electric unicycles, takes photos (preferably with his iPhone, of course), climbs around in the Hessian mountains or hikes with the family. His articles deal with Apple products, news from the world of drones or solutions for current bugs.