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

Create separate S3 bucket for user uploaded files #1

Open
cdriehuys opened this issue Oct 28, 2018 · 1 comment
Open

Create separate S3 bucket for user uploaded files #1

cdriehuys opened this issue Oct 28, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@cdriehuys
Copy link
Member

User uploaded files and static files are very distinct in terms of caching policies and the consequences of deleting files. As such, they should be stored in separate S3 buckets.

@cdriehuys cdriehuys added the enhancement New feature or request label Oct 28, 2018
@cdriehuys
Copy link
Member Author

There are a whole host of improvements we can make if we separate static files from user-uploaded media files.

CORS

Currently we have a wide open CORS policy applied to the whole bucket. We could first of all remove CORS headers from the media files and restrict the static file headers to only allow usage on our API domain.

Caching

Static files can be cached forever (as long as we make sure they are uploaded with a hash) versus media files which should not be cached at all.

Deletion Protection

The media files bucket should have deletion protection enabled whereas the static files bucket does not need it.

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

No branches or pull requests

1 participant