How to Specify a Vary: Accept-Encoding header Nginx

| Drupal Development | 67 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

Embedded thumbnail for Mumbai & Goa / India Trip

Mumbai & Goa / India Trip

It has already become something of a tradition for us - escaping the cold during our daughter’s winter school break and trading grey skies for warmth, color, and a slower rhythm of life. Each year, we carve out about three weeks to leave Tbilisi behind and head somewhere sunnier. And more often than not, that “somewhere” turns out to be India.Our…

India |

RWA Tokenization in Georgia: Key Takeaways from DGFI & Forbes Conference in Tbilisi

On April 24, 2026, DGFI, in collaboration with Forbes Georgia, hosted a conference on Real-World Asset (RWA) tokenization at the Radisson Blu Iveria Hotel in Tbilisi. The event brought together representatives from financial institutions, regulators, brokerage houses, and emerging fintech players to discuss the evolving landscape of tokenized…

Living in Georgia |