Gzip vs. Reverse Proxy Cache

I have a primarily fixed website working on Ruby on Rails that is making use of the Varnish opposite proxy cache to reduce hits to the Rails backend.

The trouble is that a customer can login to the website and also when they do we make use of ESI (edge side consists of) to show customer details components of the web page.

Making use of ESI suggests that we need to disable Gzip compression on the Rails backend (making use of Nginx+guest) or varnish can not parse the information returned from the backend in order to run ESI handling.

My inquiry is, do the advantages of making use of a reverse proxy cache surpass the advantages of gzipping all your web content? Or should I attempt to remove ESI full and also have the most effective of both globes?

2
2022-06-07 14:33:45
Source Share
Answers: 2

If transmission capacity is not a trouble, and also load times serve without gzip, you need to most definitely leave gzip switched off.

Gzipping takes a great deal of CPU sources. So, if you are extra worried concerning CPU than transmission capacity, if the website lots quickly sufficient, and also if ESI is a wonderful aid for you, after that most definitely the reverse proxy cache system has even more advantages than gzipping http feedbacks.

In others scenarios, where transmission capacity is essential, gzip can be more vital, yet it does not appear to be the instance below.

Ultimately, gzipping can be done by some reverse proxies. This is a wonderful opportunity, due to the fact that reverse proxies usually does not make use of much CPU (if they get on a different web server). This conserves the backend a great deal of CPU cycles, and also conserves transmission capacity too, yet presently, and also if I bear in mind appropriately, Varnish does not sustain gzipping.

0
2022-06-07 14:54:55
Source

You can get the most effective of both globes if you prepare points thus:

User - > nginx - > Varnish - > Rails

Turn gzip compression on from nginx to customer. That is the slowest sector as well as additionally one of the most pricey. I am thinking that your nginx, Varnish and also Rails circumstances are neighborhood per various other. Your neighborhood transmission capacity needs to be greater than enough. Besides it does not make way too much feeling to gzip just to decompress to assemble the ESI.

4
2022-06-07 14:54:42
Source