GAE still serves image from Google cloud storage after calling delete_serving_url and deleting file

The current procedure for serving the image is as follows:

  • Save Image to Google Cloud Storage
  • Get blob_key: google.appengine.ext.blobstore.create_gs_key(filename)
  • Get URL: google.appengine.api.images.get_serving_url(blob_key,size=250,secure_url=True)

To delete an image after retrieving blob_key:

  • Delete serving URL: google.appengine.api.images.delete_serving_url(blob_key)
  • Delete Google Cloud Storage File: 'cloudstorage.delete (filename)'

Question

The problem is that the url still serves for an undefined amount of time, although the main image no longer exists in Google Cloud Storage. In most cases, the url returns 404 in ~ 24 hours, but also saw that 1 image is still working now (~ 2wks).

What are the expectations regarding the efficiency of calling delete_serving_url ? Any alternatives to removing urls faster?

+6
source share
1 answer

I can answer one of your two questions. Unfortunately, this is less useful.: /

What are the expectations regarding the urgency of calling delete_serving_url?

Looking at the Java documentation for getServingUrl , they clearly state that they expect it to take 24 hours, as you noticed. I'm not sure why the Python documentation leaves this out.

If you want to stop showing the URL, delete the blob base key. It takes up to 24 hours.

The documentation does not explain why one of your images will still serve after 2 weeks.

It is also interesting to note that they do not reference deleteServingUrl as part of the process to terminate the blob function. This tells me that step (1) in your โ€œdelete imageโ€ process is not needed.

0
source

Source: https://habr.com/ru/post/971511/


All Articles