Giter Club home page Giter Club logo

Comments (7)

inian avatar inian commented on July 4, 2024 2

yup, just confirming the alternatives you proposed Bennett

from storage.

aboveyunhai avatar aboveyunhai commented on July 4, 2024 1

@fenos @inian
Quick question to be confirmed, does it mean upload("same_url_as_before") now will automatically burst the cache? If someone else access the resource via same_url_as_before without any versioning param, and still benefit from the cache and get latest data if cache burst from our side.
It's very common people wouldn't include a param when accessing a public resource, if people have to keep up with the version control/param to the lastest, then we completely give up the benefit of CDN.
Assume we have the url with the latest versioning from the server, it will just create a double round trip issue (need to wait for the url version from the server and then call grab data via that url), this will be more slow.

from storage.

inian avatar inian commented on July 4, 2024

Hey @bennettdams,

There are a few ways to do this.

  • Cache bust by adding the version parameter to your Supabase URL. By changing the version tag there, you can bust the CDN cache.
  • You can set a shorter cacheControl header when you upload, so that the CDN checks for a new asset every max-age seconds. By default this is set to one hour, and you can set a shorter time there
  • You can also bypass the cache by renaming the file itself instead of adding a version query parameter to the URL

We are looking to build a smarter cache here (eg. clearing the cache for the URL automatically when you use upsert), but that's not in the immediate roadmap.

from storage.

bennettdams avatar bennettdams commented on July 4, 2024

@inian Thanks! Just to be sure: You didn't list a new option in your comment that I hadn't already mentioned in my post, right?

from storage.

413n avatar 413n commented on July 4, 2024

That would be a really good feature to avoid workarounds to bust the cache on file update! +1

from storage.

fenos avatar fenos commented on July 4, 2024

This is now been implemented by the Smart-CDN caching

from storage.

neos04 avatar neos04 commented on July 4, 2024

This is now been implemented by the Smart-CDN caching

The smart CDN is restricted to only paid users so...🥲

from storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.