Resizing images on fly in Symfony 6 🧵

We will create a Symfony 6 based application that serves resized images on the fly, directly from AWS S3

.com software
2 min readAug 21, 2022
Photo by DeepMind on Unsplash

For one of my apps I’m in need of an application that will serve image thumbnails on demand. The images are stored inside an AWS S3 bucket.

The requirements are as follows. The application should:

  • be written in PHP8.1,
  • have few dependencies,
  • be open-sourced on GitHub,
  • have a GitHub actions pipeline to ensure quality,
  • be Dockerized for easy and quick developing,
  • cache generated thumbs locally to save bandwidth,
  • support multiple types on the output (JPEG + WEBP)
  • allow to clear the thumbnail cache en masse,
  • correctly handle concurrent access to the same image,
  • protect against unauthorized use,
  • be flexible enough to change from S3 to any other source if necessary

--

--

.com software

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