Dear Experts,
we need to compress as much as possible the amount of data we are transferring through a custom action.
We wish we could use gzip compression, which we are able to do, but we cannot set the response header with 'Content-Encoding' equal to 'gzip', consequently the front-end (SAPUI5) fails to convert it.
Action definition:

Action handler:
const { gzip, ungzip } = require("node-gzip");

We want that in the front-end we can get the string and then make a JSON parse, but this is what we get:

How can we achieve this?
Thanks
Kevin
Request clarification before answering.
Just found a partial solution.
There is no need to manually compress the response payload. Through SAPUI5, by deactivating the batch, the calls will be automatically compressed in gzip.
this.getModel().setUseBatch(false);
this.getModel().create(sPath, {}, {
success: function (oData) {
this.getModel().setUseBatch(true);
this.setBusy(false);
}.bind(this),
error: function (oError) {
this.setBusy(false);
this.getModel().setUseBatch(true);
}.bind(this),
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.