Join Discord
Powered by
Anyone aware of how the storage cache behaves: If ...
# off-topic
m
Mike_
01/01/2022, 1:42 AM
Anyone aware of how the storage cache behaves: If I upsert an item, will it automatically invalidate the cache for that item?
g
garyaustin
01/01/2022, 1:55 AM
This should probably be in help thread, but (and it is new year's eve) what is storage cache?
m
Mike_
01/01/2022, 2:09 AM
https://supabase.com/docs/reference/javascript/storage-from-upload#parameters
Mike_
01/01/2022, 2:09 AM
In the fileOptions parameter, you can specify cacheControl which defines the max-age=
for the file to be cached
Mike_
01/01/2022, 2:10 AM
I'm wondering if I upsert a file, will it invalidate the previously cached item and begin serving the new one or not 🤔
Mike_
01/01/2022, 2:10 AM
I assume yes, it just doesn't say that explicitly in docs
g
garyaustin
01/01/2022, 2:11 AM
I get it. I believe since the browser gets the cache time, you can't affect that with an update... how would you tell the browser it changed?
m
Mike_
01/01/2022, 2:12 AM
OH it's client-side.............
Mike_
01/01/2022, 2:12 AM
I see haha
Mike_
01/01/2022, 2:12 AM
Ok I can invalidate that pretty easy, just: urlToFile?version=
on client side
Mike_
01/01/2022, 2:12 AM
Thanks 😄
Previous
Next