holaplex / devops

Mostly for managing tasks that span repos...mostly
0 stars 0 forks source link

Content Optimization & Delivery #1

Closed dandlezzz closed 2 years ago

dandlezzz commented 2 years ago

We serve many IPFS and Arweave images/videos. Most of these images are way to large for their usecase, usually a thumbnail. Lets find a way to optimize this content at request time, either through a a managed service like cloudinary or some self hosted image proxy.

mpwsh commented 2 years ago

An in-house solution was developed to process and cache the incoming image requests. The server exposes a simple API which allows scaling down and converting media to a format which is easier to work with and deliver with only GET requests and query parameters.

The original media as well as the processed result will be moved to S3 after resizing, which is the first point of contact of the cloudfront CDN. The server itself will be contacted only when the required image (of specific size) is not found in cloudfront cache nor S3 bucket.

Image processing of PNG, JPEG and GIF takes around 10-20 ms, but conversion from MP4 to GIF can take a while, depending on the size of the video.
This might cause timeout issues for the first person that requests the video, but should be delivered as GIF from cache for the next visitor.

Instructions on how to deploy, configure and use can be found in the project's readme file