# Gzip proxied content, where?

**URL:** <https://www.ruby-forum.com/t/gzip-proxied-content-where/169452>\
**Category:** NGINX\
**Created:** [June 3, 2009, 10:12pm UTC](https://www.ruby-forum.com/t/gzip-proxied-content-where/169452 "2009-06-03T22:12:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 3, 2009, 10:12pm UTC](https://www.ruby-forum.com/t/gzip-proxied-content-where/169452/1 "2009-06-03T22:12:56Z")

</div>

Hi,

What is the best practice to gzip content? In the frontend or at the  
backend? Wich performs better?

Thanks

Nuno

Posted at Nginx Forum:

> **[gzip proxied content, where?](https://forum.nginx.org/read.php?2,2619,2619#msg-2619)**
>
> Hi, What is the best practice to gzip content? In the frontend or at the backend? Wich performs better? If I have gzip enabled in both backend and frontend, will I have a duplicated issue? Thanks Nuno Edited 1 time(s). La

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 4, 2009, 1:23pm UTC](https://www.ruby-forum.com/t/gzip-proxied-content-where/169452/2 "2009-06-04T13:23:21Z")

</div>

Hello!

On Wed, Jun 03, 2009 at 03:55:41PM -0400, nfn wrote:

> Hi,
> 
> What is the best practice to gzip content? In the frontend or at the backend? Wich performs better?

From performance point of view - gzipping at backend will allow  
you to save some internal network bandwidth. But

1. It won’t allow you to do frontend processing (ssi, charset  
conversions, xslt, adding headers/footers via addition\_module,  
substitutions via sub\_module; not sure how this will affect cache  
if used).

2. If other servers used as backends (not nginx), and gzipping on  
them may be a bad idea since nginx usually faster and more  
efficient.

So general practice is to avoid gzipping on backends and do this  
on nginx frontend.

Maxim D.

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 4, 2009, 4:41pm UTC](https://www.ruby-forum.com/t/gzip-proxied-content-where/169452/3 "2009-06-04T16:41:41Z")

</div>

Hi,

Thank you. I’m running nginx as frontend and apache2/mod\_php as backend.

Posted at Nginx Forum:

> **[Re: gzip proxied content, where?](https://forum.nginx.org/read.php?2,2619,2629#msg-2629)**
>
> Hi, What is the best practice to gzip content? In the frontend or at the backend? Wich performs better? If I have gzip enabled in both backend and frontend, will I have a duplicated issue? Thanks Nuno Edited 1 time(s). La
