Repository navigation
Conversation
… creation Generating variations lazily suits a local filesystem, where checking that a file exists is cheap. On a bucket each check is a request, and variations served without the MediaController (through a CDN or pre-signed URLs) are never generated when missing. With cache.store_on_create enabled, a listener converts all the applicable variations when a media is created or moved, forcing the conversion as no variation can be stored at that path yet.
…us is configured The store_on_create_message_bus setting names the bus to dispatch a StoreVariations message to, instead of generating the variations synchronously; routing the message to an asynchronous transport moves the generation to a worker. A setting that names no Messenger bus fails the container compilation.
Contributor
Author
|
@xavierlacot any spare time to review this improvement to the generation of variations and feature to dispatch that to the background? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bundle comes from a local filesystem perspective: checking whether a variation exists is cheap, and the application serves the files, so a missing variation can be generated when requested. On a bucket, neither holds. Listing media shouldn't cost a storage request per variation, and URLs served by the bucket itself (pre-signed, a CDN) never reach the application, so a missing variation is never generated.
This adds a
cache.store_on_createsetting, which generates all the variations of a media when it is created or moved. Settingstore_on_create_message_bushands that generation to Symfony Messenger, so it can run in a worker. By default, generation is synchronous and Messenger isn't required.The documentation is in
doc/misc-features/url-generation.rst.