Hello,
I use custom data source API as a datasource in Flexmonster JS. I want to convert response to binary in .net core API and convert binary to json in JS side to decrease transfer size. Transferring huge data from server to report takes too many time. I can do it in API side but can not find solution in JS side. The main purpose is decreasing transfer size. Could you please help that how can I achieve this?
dataSource:{
"type": "api",
"index": "custom",
"url": "https://myurl/api/cube"
}
Thanks,
Berkay
Hello, Berkay!
Thank you for reaching out to us.
We recommend using gzip response compression on your server to decrease the volume of data sent by the custom API server. Flexmonster automatically handles gzip-compressed responses without any changes required on the client side.
Additionally, since compression and decompression introduce processing overhead, it is important to compare the loading times with and without gzip compression.
We are looking forward to hearing your feedback.
Best Regards,
Maksym
Hello Maksym,
Thank you for responding. I have used gzip compression, it reduced the transfer size and affected the timing for large sized report. According to the Microsoft document, using https compression can expose the app CRIME and BREACH attacks. That's why I tried to find another way.
Thanks,
Berkay
Hello, Berkay!
Thank you for your reply.
If you would like to use a different, more secure compression method, you can use functional API. This approach allows the use of function as a custom API endpoint in the dataSource.url
parameter:
dataSource: {
type: "api",
url: pivotEndpoint,
index: "fm-product-sales",
}
For your use case, this function should act as a proxy between Flexmonster and your server, forwarding requests and performing data decompression and decryption on the client side.
You can reference this JSFiddle, which shows the implementation of the functional endpoint forwarding requests to the server: https://jsfiddle.net/flexmonster/gsmrzntq/. Kindly note that all matters related to decompression and decryption will need to be handled on your end.
Please let us know if this solution works for you.
Best Regards,
Maksym