You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when a file is uploaded, either via the Attachments field type, or if uploaded within a long text / wysiwyg field, the url that is generated is always something like /raytha/media-items/objectkey/abc.
The good
If storage moves to a new location, the urls will still work so long as the object keys remain the same.
In theory, can easily require users to be logged in / have some authorization by adding [Authorize] attribute on the controller, etc.
The bad
It adds request load on the server, for example, if you have a gallery list view with 25 images, that is 25 requests to the web server that need to be redirected (browser caching might reduce this but still).
Proposal:
We add an environment variable under storage that, if turned on, will output the URLs to directly to the source storage. It will default to off though.
The text was updated successfully, but these errors were encountered:
Decided to change the implementation here, simplified it, but I'm quite happy with the decision for now. This is now a choice for outputting the URL to the file via liquid filter.
Added a new filter attachment_redirect_url liquid filter which outputs the URL of /raytha/media-items/objectkey/{{ Target.PublishedContent.attachment.Value }} which is the same behavior as the current existing filter raytha_attachment_url.
Added a new filter attachment_public_url which will output the direct url to the blob on the file storage provider. A requirement of this method is that your bucket or container needs to have anonymous public-read access on the objects because it will not generate a presigned url or SaS url.
raytha_attachment_url is now deprecated. Consumers should switch to attachment_redirect_url in their templates to preserve the same behavior. To be removed in v1.0.6.
Currently, when a file is uploaded, either via the Attachments field type, or if uploaded within a long text / wysiwyg field, the url that is generated is always something like
/raytha/media-items/objectkey/abc
.The good
The bad
Proposal:
We add an environment variable under storage that, if turned on, will output the URLs to directly to the source storage. It will default to off though.
The text was updated successfully, but these errors were encountered: