New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
GZIP compression application or reverse proxy
dragon1993
Member
in Help
I have a VPS with a lot of PHP + NGINX applications.
These applications are behind an NGINX reverse proxy.
I am a little bit uncertain. What is the best practice?
GZIP with the reverse proxy or GZIP with the "application" nginx?
Comments
Not a real expert on this topic but I'd do gzip on the reverse proxy.
Why not gzip on faster server?
In most cases, if you want to gzip, you do it as close to the data source as possible then distribute. It saves the most CPU time and bandwidth. You want to make sure it's worth gziping though because it is a trade off between CPU time, bandwidth, and storage. It makes more sense for static content that's distributed many times, not so much for dynamic content.
Typically gzip compression rules are pretty granular to be effective, usually targeting JavaScript, css and other static text payloads
Frankly I'd first prioritize having http 2.0 enabled. That's a great way to improve response time in browser when there's lots of parallel requests
Every content is different, just enable to compression and check where you get best. Run benchmarks and you should have clear picture, its useless to play guess game.