I did a speed test on pingdom.com and it said that I should "Vary: Accept-Encoding header". How can I enable this on Apache2 (django). asked 22 Jan '17, 05:09 robbyzob |
I've created a django app using the installer and linked it to a website. According to curl, that header exists:
A pingdom test also gave that an A grade. This is a header the django framework adds. That said, if you want apache to add it, you will need to update your app's httpd.conf file in the
The official document is here. answered 22 Jan '17, 14:29 iliasr ♦♦ Somehow the gzip was activated (even without the django middleware) but the header encoding was missing. The two lines did help very much here. Thanks.
(22 Jan '17, 20:46)
robbyzob
|
You can now selectively enable and disable gzip compression for HTTPS websites via our control panel at: answered 25 May '17, 16:15 seanf |
Apart from
iliasr
's answer you should note that: 1. If your site runs under HTTPS you shouldn't use gzip (more on it here: breach attack) and 2. You should use the GZip middleware inside your Django project (if you are under HTTP).