Start using "data URI scheme" ... for performance

Start using "data URI scheme" ... for performance

  
Does anybody has experience using data URI schemes for images in outsystems applications to speed up performance ?
If so, how did you do it ?

Some information :
http://en.wikipedia.org/wiki/Data_URI_scheme
http://www.websiteoptimization.com/speed/tweak/inline-images/
I have touched it briefly for css-fonts. bit similar, I guess.

are sprites not easier and will achieve relatively the same performance?

Hey Joop,

In theory you can just use it with a normal Image Widget where the URL is your data URI. (And the URL is an expression so you can use images as Resources of the eSpace directly and just convert it to Base64).
Note: just thinking out about it, didn't actually test anything.

But my question would be if it actually improves the performance.
Browsers/servers/cdn's already handle cache pretty well so in theory it only affects the first request.
Considering the overall size increases 33%, more processing time and that the data URI standard only says the browsers must handle data up to 1kb (even that most browsers support more) .. I have my doubts.

If pages have many images, then I would attempt sprites way before attempting to do it with data URI's.

Regards,
João Rosado
I have an image stored in a binary field that uses the data URI sheme. (The image is a digital signature capture from a mouse or finger swipe on mobile devices).
The image below is an exmaple of the signature capture. It works really well, and fast.

My issue is that why I try to send an email with the image, the email fails with error " Error creating Email. Unable to fetch..... (then displays the URI value)  " .

The response from Outsystems was the following:

The problem in your case is that the signatures have images using the data URL scheme which is not supported by our email renderer.
 What kind of data is kept the binary data of your signatures? If it is always an image, you can use the image widget pointing to a database image which should not give you problems when generating the email.


I have tried to use the image widget with external source, but it does not display the image.
The URL field has the value "BinaryDataToText(GetTblSignaturesByRecordId.List.Current.BinaryItems.BinaryValue,Encoding:)" which ias what I use for a webscreen expression (with escape content = No) and it works fine.

Any ideas?

Hi Robbie,

Like I said it was in teory. Would need to look at the generated html to see why it didn't work.
Anyway for your problem, just use like Support sugested a Image Widget with type "Database". The image will be converted and placed inline (with "cid:" urls) by the email renderer.


Regards,
João Rosado
Hi Joao,

Please see below for an example of the data stored in the binary field. When converted to text, the html belowis extracted.

The issue s that the image widget (when using "External" as Type, will only work when you strip away the initial part:
<img class="signature-response" src=

If you manually create an expression with "data:image/png;base64,iVBORw0KGgoAAA" the string is changed, with "../../../data:image/png;base64,iVBORw0KGgoAAA..." which does not display the correct image. Using the Inspect Element in Chrome, you can manually edit the HTML and remove the "../../../" and the image displays correctly.

I have now tried to insert the string into an xml structure, stripping away the HTML tags, and then using the Type = Database route.

Will see how that goes...

Robbie



<img class="signature-response" src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAEsCAYAAAA1u0HIAAAYDElEQVR4Xu3du88k2VkH4PXuzuyCYW0Jg42E0CYIkJHAl9iOifgfLDICLEISREIITsgQCX8BETGQsjJIXIyjtRMbX+TLgtkZm8s5eAq1evpS1VXvW+ecej6p5PFO1bk87/n6N1XVXf2BV/wQIECAAAEC3Qt8oPsZmAABAgQIECDwikC3CAgQIECAwAACAn2AIpoCAQIECBAQ6NYAAQIECBAYQECgD1BEUyBAgAABAgLdGiBAgAABAgMICPQBimgKBAgQIEBAoFsDBAgQIEBgAAGBPkARTYEAAQIECAh0a4AAAQIECAwgINAHKKIpECBAgAABgW4NECBAgACBAQQE+gBFNAUCBAgQICDQrQECBAgQIDCAgEAfoIimQIAAAQIEBLo1QIAAAQIEBhAQ6AMU0RQIECBAgIBAtwYIECBAgMAAAgJ9gCKaAgECBAgQEOjWAAECBAgQGEBAoA9QRFMgQIAAAQIC3RogQIAAAQIDCAj0AYpoCgQIECBAQKBbAwQIECBAYAABgT5AEU2BAAECBAgIdGuAAAECBAgMICDQByiiKRAgQIAAAYFuDRAgQIAAgQEEBPoARTQFAgQIECAg0K0BAgQIECAwgIBAH6CIpkCAAAECBAS6NUCAAAECBAYQEOgDFNEUCBAgQICAQLcGCBAgQIDAAAICfYAimgIBAgQIEBDo1gABAgQIEBhAQKAPUERTIECAAAECAt0aIECAAAECAwgI9AGKaAoECBAgQECgWwMEfizwrGyvly37d+J/Sp//VbZ/KtsnFIMAAQKPCmS/eD06TscR2ELgNLR7Wfs18L9Ytk9tAaANAgTGFejlRW3cCphZlEA96331RuM1KOv2o7K9ETWIhe3W4P74i3FPYz/9HZ3G+3Rhu3YnQOAAAgL9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EIgVEOixvlonQIAAAQIpAgI9hVknBAgQIEAgVkCgx/pqnQABAgQIpAgI9BRmnRAgQIAAgVgBgR7rq3UCBAgQIJAiINBTmHVCgAABAgRiBQR6rK/WCRAgQIBAioBAT2HWCQECBAgQiBUQ6LG+WidAgAABAikCAj2FWScECBAgQCBWQKDH+mqdAAECBAikCAj0FGadECBAgACBWAGBHuurdQIECBAgkCIg0FOYdUKAAAECBGIFBHqsr9YJECBAgECKgEBPYdYJAQIECBCIFRDosb5aJ0CAAAECKQICPYVZJwQIECBAIFZAoMf6ap0AAQIECKQICPQUZp0QIECAAIFYAYEe66t1AgQIECCQIiDQU5h1QoAAAQIEYgUEeqyv1gkQIECAQIqAQE9h1gkBAgQIEIgVEOixvlonQIAAAQIpAgI9hVknBAgQIEAgVkCgx/pqnQABAgQIpAgI9BRmnRAgQIAAgVgBgR7rq3UCBAgQIJAiINBTmHVCgAABAgRiBQR6rK/WCRAgQIBAioBAT2HWCQECBAgQiBUQ6LG+WidAgAABAikCAj2FWScECBAgQCBWQKDH+mqdAAECBAikCAj0FGadECBAgACBWAGBHuurdQIECBAgkCIg0FOYdUKAAAECBGIFBHqsr9YJECBAgECKgEBPYdYJAQIECBCIFRDosb5aJ0CAAAECKQICPYVZJwQIECBAIFZAoMf6ap0AAQIECKQICPQUZp0QIECAAIFYAYEe66t1AgQIECCQIiDQU5h1QoAAAQIEYgX+F/4ZMUugCH4RAAAAAElFTkSuQmCC' />
Can anyone from Outsystems help with this one. I need to have it sorted as soon as possible,.

How to display a data URI scheme for an image in an email (currently is not supported by Outsystems Agile Platform email renderer)

Robbie

Hi,

I also have this problem. I need to place a tracking pixel inside emails and this way there is no tracking.


AB