question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storage download (storage.from.download url) is cached in the CDN even for deleted file

See original GitHub issue

Bug report

It is desirable to cache image and some file urls. The storage download function though seems more like a database call to get the file data from the database/storage system. A deleted file from storage (no object and data) will still download when called with supabase.storage download. Cache busting with ?bust=123 in the path provided to download does return 404. The download url does not appear to be cached in the browser, using a 2nd browser will still return a file even though deleted and never used on the browser. After 1 hour the download function does get a 404 error.

To Reproduce

Create a file in the UI in a private bucket. Download it with:

  .storage
  .from('avatars')
  .download('folder/avatar1.png')

Delete the file. Run the download code on any browser and file still downloads.

Expected behavior

This behavior should at least be documented as it is not clear download is cached by it appears just the CDN. Or download should not be cached at all as it is more like a database call then a url for an image.

Screenshots

System information

Latest Supabase instance and supabase.js code.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
GaryAustin1commented, Apr 7, 2022

You need to do the cache busting string added at end with time. ?bust=95857573738 for now.

1reaction
rahul3vcommented, Apr 12, 2022

Well, In that case you can store something as update_time under your Database, (as we prefer to do, when we update anything…right !), and use that as a reference under any image url (let say <Image_url>?t=<update_time>), that will reduce a lot many hits, and also able to use cached file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloud Storage the deleted file still accessible - Stack Overflow
I setted 1 hour caching options while I uploading the files to cloud storage which is I totaly forget. I changed 1 hour...
Read more >
Download files with Cloud Storage on Android - Firebase
Cloud Storage for Firebase allows you to quickly and easily download files from a Cloud Storage bucket provided and managed by Firebase.
Read more >
Quickstart: Integrate an Azure Storage account with Azure CDN
In this quickstart, learn how to use the Azure Content Delivery Network (CDN) to deliver high-bandwidth content by caching blobs from Azure ...
Read more >
Caching | Cloud Storage - Google Cloud
Cloud Storage behaves like a Content Delivery Network (CDN) with no work on your part because publicly readable objects are cached in the...
Read more >
I've replaced an existing asset with a new file, but my site or ...
If the asset was already in use in your application or website, when accessing existing URLs for that asset, you may still see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found