Open rubenheymans opened 4 years ago
I think good solution to this would be if the image URL's for each size could be cached on the document so they are downloaded with the original request, that way there is no need to specify an array of sizes on the request and there is no additional network ingress from the internal call to getDownloadUrl() which I am finding a bottleneck. This solution would also make using srcset trivial.
I would also like to know if its possible to implement this feature. It'd be great.
@gitdubz Can you please let us know if you're adding this in near future ?
Hi @nrgnrg @thelazyindian
I will investigate what changes need to be made. From an ease of use perspective this makes sense. In the event that we do make the changes for this functionality it would make sense to handle an array of sizes to populate the value.
In addition to this, an update to the schema builder will be done later this year to choose between storing file/image data as a reference or the value itself. This will reduce network calls as mentioned, but can also cause issues if access tokens are revoked or expire. We are looking into the last part before making these changes in the CMS.
Good to know!
I have a schema 'realizations' with field 'images'. For every image I want a small and a large image to use in a lightbox. I managed to do this with a workaround:
A better solution, as suggested by @jperasmus , would be to use a an array of sizes to the populate field:
Which then returns the entries with a sizes array that includes the url for each size.