As many of you already know, I spend my whole day dealing with customer websites, which are usually based on Wordpress. For the reason today again a tip that I just learned myself when I was using the loading time of a website Tool from Pingdom controlled.
The site had received A grades (equivalent to grade 1) across the board, but a lone "E" (grade 5) entry with the message "Specify a Vary: Accept-Encoding Header." Incidentally, this message is not only available with the loading time tool from Pingdom, but also with other tests such as GTmetrix or Google PageSpeed Insights.
What does this warning mean?
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:
- How to cut a SIM card
- When the iPhone stops working ...
- Image processing GIMP as download
- G4 and GU4 LED lamps
- Movie4k.to alternative to streaming series
Fix via the .htaccess file
As always, my warning at this point: Before you work on the .htaccess file in the WordPress main directory, please make a backup copy. And changes this file only by FTP program. There are Wordpress plugins that allow you to make changes to 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 until then. So it's better to work on it straight away via FTP.
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 again at Pingdom, the point where there was an “E” before was now an “A” in the rating. Surgery successful!
Jens has been running the blog since 2012. He acts as Sir Apfelot for his readers and helps them with technical problems. In his spare time he rides electric unicycles, takes photos (preferably with the 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 to current bugs.