Fixes #4010 Remote Images for API Integrations #4019
Draft
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.
This draft PR provides a mechanism for using remote images for API integrations, via remote stream wrappers. This means that the original image is not stored locally, and instead fetched as needed, with only computed image derivatives for styles being actually stored on the site.
This was part of a proof of concept investigation about whether we should potentially try to avoid fetching local copies of external images; the alternative to this approach is fetching each external image via queued download and also periodically needing to determine if the local image and the remote image match and remain in sync.
Presently this functionality of creating the remote image takes place in an event subscriber; before this PR leaves draft status it should be converted to a process plugin.
Todo:
Note: in testing, one potential issue I've noticed with this approach is that Trellis event image URLs are extremely lengthy. We would need a solution for URLs which are too long for the uri path in the files managed table.
Related issues
#4010
How to test
az_http
andaz_person_profiles_import
/admin/config/az-quickstart/settings/az-person-profiles-import
/admin/content/profiles/import
/admin/content/files
contains links to the original photo, off-siteTypes of changes
Arizona Quickstart (install profile, custom modules, custom theme)
Drupal core
Drupal contrib projects
Checklist