Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize using the library with Nginx as a proxy to AWS S3 #44

Closed
davidfischer-ch opened this issue Nov 26, 2020 · 3 comments
Closed

Optimize using the library with Nginx as a proxy to AWS S3 #44

davidfischer-ch opened this issue Nov 26, 2020 · 3 comments

Comments

@davidfischer-ch
Copy link
Contributor

davidfischer-ch commented Nov 26, 2020

Hello,

I am glad to find someone willing to keep the project alive !

I cannot open a pull request to your repository because you forgot to click "fork" when bootstrapping your fork ...

I made a pull request to the original repository johnsensible/django-sendfile#73.

Hello,

Many years ago I made some changes for the sole purpose of integrating this module into both personal and professional projects that are running on Amazon Web Services and using S3 as a backend for the media assets.

This module helped me to build a secured yet scalable and efficient assets storage by proxyfing S3 with Nginx.
The applications are offloading data transfers to Nginx thanks to X-Sendfile header.

In such a setup, trivial operations such as computing mime type or file size requires unnecessary roundtrips (and data transfer) from S3 to the servers. I investigated the issue and found a neat way to optimize such a setup.

Basically I had two means to optimize the storage :

    Precompute values (e.g. mimetype and size) and store into the application's DB.
    Let the backend (Nginx + S3) do their job (return HTTP 404 if file is missing, add Content-Type header, etc).

Actually there two projects running in production (Django and Flask) with this module (my version of it).

I would be glad to contribute to this repository and offer the opportunity to other users to use these features ...

Thank you for reviewing the changes.

Best Regards,

David Fischer

Is it possible to integrate these changes by cherry-picking commits (git cherry-pick) ?

Thank you.

PS : I guess its more or less related to #34 and its even fixing #39.

@davidfischer-ch
Copy link
Contributor Author

I am quite busy nowadays (work, family, ++) but I may find some time to lead this.
I just cannot commit to a deadline as of today.

@moggers87
Copy link
Owner

Hi David

I cannot open a pull request to your repository

If you fork my repo, then you can push your branch to your fork of my repo. Git supports multiple remotes, so then it'd just be a case of adding this new fork as a remote to your local repo and push your branch there. However, that's not really going to help because:

Is it possible to integrate these changes by cherry-picking commits (git cherry-pick) ?

No, you'd have to rework your changes to make it work with django-sendfile2. We've made too many changes for it to be a simple cherry-pick.

@davidfischer-ch
Copy link
Contributor Author

See #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants