Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

image optimization using s3 as source #858

Open
@yasserf

Description

@yasserf

When a user uploads an image, instead of it being written to the lambda file system (seen here) we can instead use an s3 bucket (possibly even the one we normally use for deployment).

Since we deploy on edge + not really knowing how long lambda tasks last + using up memory in a lambda function doesn't scale well financially (https://aws.amazon.com/lambda/pricing/). It also means whenever doing a CloudFront cache bust we end up having to redo all the images.

We can also use the expiration logic on S3 objects to automatically clean up objects that expire similarly to nextJS.

So we could move to this sort of setup instead similar infrastructure instead.

That way the solution would work globally which is quite nice instead of being duplicated per edge server.

The other solution might be always optimizing it and allowing CloudFront to cache the responses. That way we avoid using lambda memory and depend on CloudFront functionality instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions