Storage CDN not working or wrong URL?
I've tested a URL from Supabase Storage vs. my current CDN (DigitalOcean Spaces) and there is a huge difference. I've got the URL from Storage dashboard > Copy URL and it looks like this:
https://abghekjureweajqqcvks.supabase.co/storage/v1/object/public/public/foo.jpg
I've run the test several times using this tool:
https://speedvitals.com/ttfb-test
The difference for example from Los Angeles is huge:
1.3s Supabase Storage VS 96ms DigitalOcean Spaces.
It's slower significantly on average across all other test locations.
Am I doing something wrong? Is there a different URL for CDN? Like via from.list()
in JS client?SpeedVitals
Measure TTFB from 35 Locations - SpeedVitals
Perform TTFB (Time to First Byte) Test on your Website from 35 Locations Worldwide and find out how fast is your website.


25 Replies
The image URL you used is correct it is the same as you would get using getPublicUrl.
I ran a quick test this morning (us-west) on a public jpg file. First time most were red 1 sec kind of numbers with a couple 100msec. Then every run after looked more like attached images with the couple of slower ones moving around each time.


@garyaustin thanks for checking this. OK yes, I run it a few times for same file and it seems to become greener, though still the average TTFB is worse than DigitalOcean, esp. for Europe region (US is our main market, but Europe still accounts for 1/3 of users).
Is it possible that this is somehow affected by the
?t=2022-08-15T15:11:57.283Z
parm at the end of the URL?
I tried to run it without and it seems to be better...?Yes That is a cache buster string, everytime it changes you go all the way back to s3 for the file...
Well I say that. I'm not actually sure how the CDN's work with it. I know it busts the browser cache. I suspect it impacts the CDN's too.
But if run the test for:
https://abghekjureweajqqcvks.supabase.co/storage/v1/object/public/public/portugal-destination-weddings.jpeg
vs.
https://abghekjureweajqqcvks.supabase.co/storage/v1/object/public/public/portugal-destination-weddings.jpeg?t=2022-08-15T15%3A24%3A21.253Z
(a URL I just got via Copy URL a moment ago from Supabase dashboard), shouldn't it be the same?
...looking at the time stamp it seems like it expired already...?In the dashboard there is a button to click to get the url.
The string is just there to change the URL so if for instance you updated the file, with a new time on that string the browser/cdn? would not get it from cache.
It all goes to the same s3 file as ? is ignored in storage.
KeyCDN
What is Cache Busting? - KeyCDN Support
Cache busting solves browser caching issues by using a unique file version identifier to tell the browser that a new version of the file is available.
Ah OK, got it. So this ?t time stamp is not when the cache expires, but when the file was uploaded / updated, right? So when it changes, the cache will be busted because it will be a new URL.
Not exactly. It is not stored at all. I think it is just added to the URL in the dashboard when it paints the image each time. I suspect it is different eachtime you come in.
but can I use the URL without the
?t
? I'd like to have clean URLs on my website
(I'm OK if I'll have to replace a file with different name if I need to update it)You want to NOT use it. That is only from copying the url from the image. If you click the button below the image it will be clean.
The only time you add a ?time string is in your own code when you DO NOT want a cached version. Like in an admin interface where you can upload a replacement and need to see it now.

Ahhh OK, got it now.
Just tried this button, still copies URL with
?t
🤔 In any case, if in Production I will use URLs without it, I can just remove it myself before running the test.That is odd, Must mean you uploaded a file with that in the name, which you should not do.
Running the test again (on https://tools.keycdn.com/performance this time).
Current CDN:
https://ppw.fra1.cdn.digitaloceanspaces.com/pics/xl/attWk5zeqJZn2XtSG/portugal-destination-weddings.jpeg
Supabase Storage:
https://abghekjureweajqqcvks.supabase.co/storage/v1/object/public/public/portugal-destination-weddings.jpeg
Exactly the same file this time just to be sure. It get's better for Supabase each time I re-run the test, but still quite a bit of a difference. Sometimes New York is 100-200ms, sometimes over 900ms 😖
Not sure how fast CDN is propagated or whatever. The files on DigitalOcean have been untouched for ages now. So maybe I'll try in a few hours or tomorrow.
KeyCDN
Performance Test - Check URL Speed From 10 Global Locations | KeyCD...
Single asset performance test from 10 locations. Analyze the TTFB, DNS, TLS and connection times for any URL.
Speed of the CDN's is beyond my skill level...
OK, thanks anyway! I'll reach out to Supabase guys to see what they say.
Here just for the record / benefit of others:

Odd here is my run from Texas (several runs all generally the same)

Your SB file.
Your digital ocean file was about the same.
yeah it seems to improve overall every time I run the Test. But occasionally New York, Sydney or Tokyo jump to 600ms+
It happens wit DigitalOceal file too, but my impression it is less
And my location should not matter, if I understand the test.
This is what I understand too (the whole point of CDN I guess).
No I think the test is run from their location(s).
anyways, I'll observe for few days ...gotta make sure brides-to-be hungry for high res photos get them fast 😝
👍