How to Specify a Vary: Accept-Encoding header Nginx

| Drupal Development | 69 seen

The other day I visited tools.pingdom.com to test performance for my blog (the one you are currently reading) and I did fine I have a two bottlenecks:

I managed to handle query string issue for static resources and then I headed to find a solution for the Specify a Vary thing. Since it's not a Drupal related issue I did some search regarding Nginx and I soon found excellent solution on stackoverflow.com

How to Specify a Vary: Accept-Encoding header Nginx 

Inside the server { of the domain/subdomain that you want to set it, add

sudo nano /path/to/domain/sites-available/yourdomain.com

gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
gzip_vary on;

Save the file (CTRL-O and CTRL - X)  and restart Nginx (sudo /etc/init.d/nginx restart)

I managed to improve my performance score from 82 to 88 on tools.pingdom.com after this.

 

Latest articles

LEGOLAND Berlin Review: A Fun Family Activity in the German Capital

When planning a family trip to Berlin with children, most travelers immediately think about the Berlin Zoo — and rightly so. But if you are spending a few days in the German capital with younger kids, another solid half-day activity is the LEGOLAND Discovery Centre BerlinWe visited it in April 2026 together with our 7-year-old daughter during our…

Germany |

Ādģēri: The 30K Mistake That Turned Into a Long-Term Experiment

In 2023, we bought Ādģēri in an online auction.Price: just over €30,000.Financing: ~6% interest.Total expected payment over ~5 years: ~€40,000.Status (April 2026): more than half already paid.On paper, it was a bad deal.Realistically, we overpaid by at least 5–6× relative to what the property was objectively worth at the time. No serious buyer…

Ādģēri |