Comments (3)
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.
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.
That makes sense. Your opinion is also converging with the suggestion that @rodolphoeck gave me yesterday on IRC.
from django-revproxy.
Related Issues (20)
- https server not work
- Release 0.10.0 as old version does not allow urllib3 > 1.17 HOT 1
- django authentication and permissions HOT 1
- Add ability to not stream big response or at least override MIN_STREAMING_LENGTH HOT 1
- Websocket Proxying Support (Django Channels) HOT 4
- How to set upstream to same server HOT 2
- Broken image on pypi page HOT 1
- AttributeError: 'HttpResponse' object has no attribute '_headers' HOT 22
- Implement Jazzband guidelines for django-revproxy HOT 24
- Is there any equivalent of this package for Flask? HOT 1
- Question regarding path - Maybe stupid, but I would need some help HOT 3
- Grafana 403
- When will the fix for django 3.2 be released? HOT 38
- Fix compatibility for python 3.10 HOT 1
- Random subdomain as upstream or multi upstream domain support
- ModuleNotFoundError: No module named 'kerberosrevproxy' HOT 1
- Proxy replaces space encoded as %20 with + HOT 1
- Incorrect handling of "max-age" attribute of HTTP Cookie HOT 1
- quickstart is missing some examples HOT 2
- Emitting original path HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-revproxy.