[MGNLREST-126] Investigate: Return binary as base64 encoded, performance caused for client side Created: 11/Oct/17  Updated: 23/Oct/17  Resolved: 20/Oct/17

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sang Ngo Huu Assignee: Dai Ha
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 1.5h
Time Spent: 1d 2.5h
Original Estimate: 1.5d

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: REST Queries
Sprint: Saigon 118
Story Points: 3

 Description   

When listing dam workspace, binaries will be return as base64 encoded. It is too heavy for client side.

We need to find other solution to serve binary



 Comments   
Comment by Christopher Zimmermann [ 16/Oct/17 ]

This is a serious problem. Requesting assets could attempt to return a 50MB response.

I think by default no binaries should be returned in REST requests. Typically, a link should be returned instead.
Can we detect when things are binaries?
I could see an additional configuration parameter which would cause binaries to be returned.

A workaround in some cases is to set the depth parameter such that no binary is returned. But this will cause problems in some cases where you want things at the same depth of the binaries.

Comment by Mikaël Geljić [ 20/Oct/17 ]
  • By default, binaries are *not* included in any reponse; because default nodeTypes are mgnl:content and mgnl:contentNode. mgnl:resource is not in there.
  • We add a specific paragraph into our README documentation, advising on "Serving binary content". Currently, this indeed has to be done by configuring mgnl:resource in nodeTypes, but me must warn that this may not be desirable if the binary content is larger than medium-sized images.
  • If mgnl:resource is configured, we do not filter any base64-encoded property. Client can still process this (as a data-uri), if they want to.
  • Finally, we acknowledge that this is not the most ideal way to serve binaries; and we file a ticket to support link generation for binaries.
Generated at Mon Feb 12 06:56:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.