Search code examples
ibm-cloud

Aspera Node API /files/{id}/files endpoint not returning up to date data


I am working on a webapp for transferring files with Aspera. We are using AoC for the transfer server and an S3 bucket for storage.

When I upload a file to my s3 bucket using aspera connect everything appears to be successful, I see it in the bucket, and I see the new file in the directory when I run /files/browse on the parent folder.

I am refactoring my code to use the /files/{id}/files endpoint to list the directory because the documentation says it is faster compared to the /files/browse endpoint. After the upload is complete, when I run the /files/{id}/files GET request, the new file does not show up in the returned data right away. It only becomes available after a few minutes.

Is there some caching mechanism in place? I can't find anything about this in the documentation. When I make a transfer in the AoC dashboard everything updates right away.

Thanks, Tim


Solution

  • Yes, the file-id base system uses an in-memory cache (redis).

    This cache is updated when a new file is uploaded using Aspera. But for files movement directly on the storage, there is a daemon that will periodically scan and find new files.

    If you want to bypass the cache, and have the API read the storage, you can add this header in the request:

    X-Aspera-Cache-Control: no-cache
    

    Another possibility is to trigger a scan by reading: /files/{id} for the folder id