I’m creating a web service that will return XPS documents that are “queued” by other users. I’d like to minimize the number of requests, therefore I was thinking of combining the resulting queued files into one response:
"Files":
[
{"Id": 1, "ContentType": "application/vnd.ms-xpsdocument", "Data": "base64-encoded data of file here" },
{"Id": 2, "ContentType": "application/vnd.ms-xpsdocument", "Data": "another files base64 data"}
]
Is this a terrible idea? Is there anything I should be concerned about? Because multiple servers will be polling this API, I’d really like to minimize the number of requests sent. If there is a better way to do this, I’d really appreciate any suggestions.
FWIW, the method I was planning to use to base64-encode/decode the files was taken from this question.
Zip/compress the files into an archive? That avoids the base64 explosion of data.
EDIT: As you also asked in the comments how to handle metadata for each file, let me summarize here for easy future reference: