Giter VIP home page Giter VIP logo

Comments (3)

seocam avatar seocam commented on July 30, 2024

Even though I'm the one who opened this issue in first place I'm not totally convinced that we should allow transformations on compressed responses.

Actually it could be a bit silly. Imagine the scenario where we have three HTTP servers:

A - Proxied Web App
B - django-revproxy instance
C - Nginx, Varnish or any other reverse proxy app

Let's also add a fourth actor D which would be the browser performing the request.

So once D does a request it will specify (using Accept-Encoding header) if C should or should not respond with a compressed content.

C will send over the request to B (including the Accept-Encoding header) and B will send the same request to A. Currently B (which is us) removes the Accept-Encoding header.

Let's say we don't remove the encoding and that A compresses the content using gzip. In that case B would have to umcompress the content, do all it's processing and afterward compress it back before sending the response to C and then back to D. That seems good because the user got his content compressed as he was expecting.

Now what happens if instead of removing the Accept-Encoding header we set it to "identity"? Basically D would request to C that requests to B (removing the header) that requests to A that responds with a plain response to B! Is that bad? I don't know, because once C gets the response back it knows that D accepts encoded content so C will do the compression and D will get the exact same content than the scenario above.

The difference here is that the content goes from A to B and from B to C as plain contents spending a little more bandwidth and time but using less CPU as well. I'm not even sure if the time to compress is lower than the time to transfer.

I'm assuming here that this is only for HTML request/response. Since we don't apply transformations we can transfer content encoded from A to D without any problems.

Thoughts?

from django-revproxy.

terceiro avatar terceiro commented on July 30, 2024

In the end performance will depend on several aspects:

  • whether A, B and C are together in a fast local network, and how much bandwitdh it has
  • on the actual processing power of A, B and C
  • on the number of nodes playing A, B, and C
  • on the expeced number of clients (D)

I think you might want to add that as a configuration option, but the only way to know if it's worth letting A compress responses would be to test on an actual deployment infrastructure.

from django-revproxy.

seocam avatar seocam commented on July 30, 2024

That makes sense. Your opinion is also converging with the suggestion that @rodolphoeck gave me yesterday on IRC.

from django-revproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.