Add (image) caching microservice #27

Open
opened 2023-08-30 07:12:18 +00:00 by lauri · 1 comment
Owner

The cached content could be placed in S3 bucket, if it exists there redirect to signed URL otherwise attempt to fetch from original URL and upload it to S3 bucket.

The microservice could keep in-memory lookup table of items it knows are in present on S3.

The cached content could be placed in S3 bucket, if it exists there redirect to signed URL otherwise attempt to fetch from original URL and upload it to S3 bucket. The microservice could keep in-memory lookup table of items it knows are in present on S3.
Author
Owner

This setup could/should somehow support workers that preemptively get the content cached, maybe by watching events on the original bucket a'la:

with client.listen_bucket_notification(
    "my-bucket",
    prefix="my-prefix/",
    events=["s3:ObjectCreated:*", "s3:ObjectRemoved:*"],
) as events:
    for event in events:
        print(event)

Note that the content on the URL should be immutable, so best candidate would be to use hash of the content in the original URL

This setup could/should somehow support workers that preemptively get the content cached, maybe by watching events on the original bucket a'la: ``` with client.listen_bucket_notification( "my-bucket", prefix="my-prefix/", events=["s3:ObjectCreated:*", "s3:ObjectRemoved:*"], ) as events: for event in events: print(event) ``` Note that the content on the URL should be immutable, so best candidate would be to use hash of the content in the original URL
Sign in to join this conversation.
No description provided.