Conversation
With Neos 8.4 I created a thumbnail to be able to generate the width and height for the image attributes. But in case of `async = true` the initially created thumbnail is async and has no resource and the ResourceUri throws an error. So we provide a fallback for the first time the thumbnail is requested in which the image size cannot be calculated. After a reload everything is back to normal and the thumbnail and its size are usable. Resolves: #5717
|
This solution is a bit messy. I'm open for a neater implementation for the special asynchronous case. |
mficzel
left a comment
There was a problem hiding this comment.
I see no real difference compared to making the image non-async. Maybe i do not understand the solution fully.
Would'nt the correct way be to calculate (or predict) the target dimensions of an asymc-thumbnail directly the moment we create the async asset. I played with that in the focal point pr from back then (see #5127). Maybe that part can be reused. However it may be way to breaky for a bugfix.
It is still async. If the resource is not available yet, it will create an asynchronous uri with the ImageUri the |
|
I have a general question regarding async images (feel free to ignore me if that's out of scope): will render the fallback on first hit usually. If that's a regular frontend request, the result will be "baked" into the cached content of the embedding Fusion constructs and it would never be re-evaluated until caches are flushed. |
|
@bwaidelich eventually there will be a Cache flush after which the final urls will be rendered. As least we usually flush fusion caches during deployments so this seldomly takes more than a few days. |
For large scale & high traffic websites flushing the complete content cache is not really an option because it would kill the server (not to imply that you don't have those kind of websites, but maybe your server setup is stronger *g) |
As I said before, I advise only using it in the backend. After getting weird reports from SEO tools, having the URLs staying to long in the cache (like you mentioned), not wanting to have urls like that reachable from the outside, etc. I disabled it for the live rendering in all customer projects. But in the backend it's helpful, when each image has 10 responsive variants etc. and editors are playing around with images and cropping. |
|
@Sebobo that makes a lot of sense, thanks! |
About caching: We use rolling updates, autoscaling and green/blue caches to be able to start each release with fresh caches (not all caches). Since eventually fusion caches sometimes need flushing after code evolved we built the rollout process to survive that in the first place. For the async topic here I would be totally fine with changing the default for async to off again but would not do automagic for the backend and also consider this breaky. Can you explain to me why the suggestion to precalculate the dimensions of async images is not a possible solution to the mentioned problem of missing width and height for not yet rendered async images? That would be a clear feature that can be added in a minor release. |
I didn't mean it's not possible. Just not implemented, but of course it would be great next addition 🙂 |
With Neos 8.4 I created a thumbnail instead of an ImageUri to be able to generate the width and height for the image attributes. But in case of
async = truethe initially created thumbnail is async and has no resource and the ResourceUri in the src attribute throws an error.So now I provide a fallback for the first time the thumbnail is requested in which the image size cannot be calculated. After a reload everything is back to normal and the thumbnail and its size are usable.
Resolves: #5717
Review instructions
In the demo this can be verified by adjusting the
Neos.Demo:Content.Imageprototype and using it in the Demo with some cropping.