Hey all,
I'm trying to decide on the best approach in using (and optimizing) images in an Astro SSG Website, that are uploaded to a Directus CMS.
- My initial approach was to access the images via a shared folder during build time and do the optimizations with the experimental assets feature. This however has some limitations since in need to dynamically import the image files and don't know the file extensions beforehand. Directus also disencourages the reliance on a shared folder and instead suggests to download the images via the api, to ensure permissions are applied.
- Directus on the other hand also provides an image transformation Feature, where one can also define default transformations that will be created on file upload. I however don't want users to request the images from the CMS API, rather i'd like to download the used images during build time. and provide them as public assets. I'm not sure if there is a best practice to achieve such preloading in Astro and would probably build a small util that writes the downloaded resources to the file system.
Has anyone experience with such a use case?