Serving resized S3 images on the fly

#5 Serving thumbnails

Let’s create an MVP and serve random thumbnails

.com software
3 min readAug 31, 2022

--

Photo by James Harrison on Unsplash

If you didn’t notice — this is part of a series

Serving thumbnails

The reason for the app is to dynamically create thumbnails of images stored in a remote source (AWS S3 bucket in this case).

Below is the UML sequence diagram of a typical request:

Sequence diagram from diagrams.net

The URL /t/fixed/100x100/webp/a/b/c/1.jpeg can be broken down into the following parts:

  • /t/ is just a prefix of the route (a shortcut for thumbnail)
  • fixed is the name of the resize strategy to use
  • webp is the requested output format of the thumbnail
  • a/b/c/1.jpeg is the id of the image in the source

By design, the application should:

  • support multiple resize strategies
  • support multiple output formats
  • allow any image id to be passed
    (eg. foo/bar/image.jpeg or dir/name/files/source.jpg)

--

--

.com software

Father • PHP developer • entrepreneur • working for a €1bn unicorn startup as a backend engineer >>> https://bit.ly/dotcom-software