Delayed access to the image after uploading


The image is unavailable for a while after uploading - usually 10-50 seconds. Is this how it should be? And how can this be bypassed - so that the user of our service can see the picture immediately after uploading it?

Thank you

I want to clarify a certain point - inside one Worker:

  1. The user makes a query on a picture with unique ID
  2. Worker check with fetch whether such image is in CF Images (, if it is, we respond it to the user
  3. If not, we download it from our server and upload it to CF Images
  4. Using fetch from CF Images ( respond it to the user

In this case I think there is caching in step 2 and therefore image is not available in step 4.

I will try to check point two not via but via API.

Checking if the image exists through the API works as intended, but the response time increases by 800ms in total.

I think the issue is that two fetch subrequests from in one the worker are cached in some hidden way, so the second fetch returns expired data.

Perhaps there is some information on how to get around this?

there is a negative cache.
you can check by fetching different variant of an image, but this will add to the billing costs.

It seems to be some bug: if in one Worker you check if a picture exists in CF Images via API - everything works as it should. But if you check image via - and then upload it if not exist - some sizes (or even all of them) are unavailable for 30-60 secs

It seems the lack of an image is cached for a while, even if it’s uploaded afterwards - it’s probably worth resetting that cache instantly after the image is uploaded. Otherwise, non-consistent behavior is obtained.

The cache is reset instantly when deleting, probably the same should be done after uploading.

Please add a reset of the image state cache on upload (the same as on deletion) - this will allow to create APIs to move images on-demand (in one request) to CF Images CDN, e.g. from an old host or IPFS. Thank you! :roll_eyes:

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