Currently the ETag used for the work results in S3 (as well as browser cache) is computed both in the UI and API, requiring identical code producing the same output to work right. This is an unstable and complicated solution which needs to be changed.
The API as a brain should take care of dispatching work or retreiving results from S3 instead of relying on the UI to decide that.
It is possible to remove the ETag computation from the UI entirely and do it only in the API. The UI will send a plain text object with the work request and the API can return its tag back to the UI.
Currently the UI decides whether to dispatch a work request or seekFromS3. This should be moved to the API as the UI will only hit the API endpoint for work and the API will decide further. The API then after calculating the Etag can return it back to the UI, allowing the UI to use that Etag further for things like using the browser cached results.
GOALS
Remove the ETag from the UI, making the UI only take care of building the work body and nothing else, sending it to the API and letting the API take care of:
[DESIGN DOC] - https://docs.google.com/document/d/1YXe5nqxaNZ0-QqXG591sppqNT8qftJExgqIGriETDHI/edit
Currently the ETag used for the work results in S3 (as well as browser cache) is computed both in the UI and API, requiring identical code producing the same output to work right. This is an unstable and complicated solution which needs to be changed.
The API as a brain should take care of dispatching work or retreiving results from S3 instead of relying on the UI to decide that. It is possible to remove the ETag computation from the UI entirely and do it only in the API. The UI will send a plain text object with the work request and the API can return its tag back to the UI.
Currently the UI decides whether to dispatch a work request or seekFromS3. This should be moved to the API as the UI will only hit the API endpoint for work and the API will decide further. The API then after calculating the Etag can return it back to the UI, allowing the UI to use that Etag further for things like using the browser cached results.
GOALS
Remove the ETag from the UI, making the UI only take care of building the work body and nothing else, sending it to the API and letting the API take care of: