Aspera

 View Only
Expand all | Collapse all

Managing Node API Cache

  • 1.  Managing Node API Cache

    Posted Mon December 13, 2021 07:43 PM

    Hi all, I am creating an integration with Aspera on Cloud and am trying to fetch metadata for files within a directory immediately after a new file has been uploaded.

    Within postman I'm sending a GET request to {{baseUrl}}/files/:id/files and it is successfully returning metadata for the provided folder.

    The problem I'm seeing is that the results of the request are being cached for some period of time, even if new files have been added to the directory. I would expect to receive up to date results once a new file has been uploaded.

    How can I invalidate the cache when a new file is uploaded? I do see that the Node api is providing the cache info in the "X-Aspera-Node-Cache" response header. I'm not sure what to do with that though.

    Any help would be greatly appreciated.

    Thanks,

    Tim



    #AsperaonCloud
    #Support
    #SupportMigration


  • 2.  RE: Managing Node API Cache
    Best Answer

    Posted Tue December 14, 2021 01:33 AM

    Add the following in the GET request header:

    X-Aspera-Cache-Control: no-cache



    #AsperaonCloud
    #Support
    #SupportMigration


  • 3.  RE: Managing Node API Cache
    Best Answer

    Posted Tue December 14, 2021 03:20 PM

    Thank you Laurent, this worked for me!



    #AsperaonCloud
    #Support
    #SupportMigration