Retrieving info for a bunch of images at a time

I’m working on a browser page for the images stored on CF images.
The upload process saves the img name/id in a KV space so later another worker can pull individual images by file name by getting the img id from that KV space.

Thinking on the most efficient API calls to get the necessary info to build a page (need both img name and id for a bunch of images). The options I see are:

  • Images List: provides all info, but max 100 per page, no prefix filtering. Would have to retrieve all and filter locally to decide which images to show. Too many API calls
  • KV List keys: max 1000 per page, allows prefix filtering, but only provides keys so then EACH value (image id) must be retrieved individually. Too many API calls
  • Keep img names/values stored somewhere else: it gets cumbersome to administer and keep sync’ed, plus that’s what KV should be for.
  • Store the value of a KV pair in the metadata: the metadata is retrieved on KV list calls (1000 items per call, filtered by prefix). BINGO?? Is there any downside of storing the value of each KV pair in its metadata?

This topic was automatically closed after 15 days. New replies are no longer allowed.