Cache Control in Remix Loaders

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 16

  • @PeterWhite-j1w
    @PeterWhite-j1w 10 місяців тому +2

    Dude... I'm building a SaaS MVP with Remix and it's like every time I have a question or hit a wall you post a new video answering the EXACT thing that I'm struggling with, answering it simply and sweetly. Thank you so much for these videos! 🙌

  • @hamdaniash-siddiq5021
    @hamdaniash-siddiq5021 Місяць тому

    the way u ask Copilot for 5 minutes is absolutely georgous. Everybody does it.. 😁😁😁

  • @rahmatsulistio
    @rahmatsulistio 10 місяців тому +2

    Can you make a tutorial about the best practice for filtering and pagination for admin pages?

  • @RogerStudner
    @RogerStudner 7 місяців тому

    when I do this, I never see the size coming from the disk (around 3:02 in the video). Is this due to being in localdev?

  • @jimshtepa5423
    @jimshtepa5423 10 місяців тому +3

    if it is stored in the browser then the request from the next user fetching that data will still need to hit the db because second user doesn't have access to the browser of the first user?

    • @rulesandwisdom
      @rulesandwisdom 10 місяців тому +2

      Agree, the way it's described in this video is misleading! Saying that - in this example the cache control was set to public, so if the URL was fronted by a properly configured CDN or other caching layer, it could be cached in there and speed up the next request for other users too.

    • @sergiodxa
      @sergiodxa 10 місяців тому +3

      When using Cache-Control the cache is stored in the browser and/or any proxy (like a CDN) in the middle, this is all customizable using the max-age and s-maxage directives on the header, if only cached in a browser then yes a second user will need to hit the server again, but if cached in a CDN it will be shared between users

    • @jonathanblair4246
      @jonathanblair4246 8 місяців тому

      He discussed how this can be used on the CDN layer @5:12

  • @jimshtepa5423
    @jimshtepa5423 10 місяців тому

    where is the asset stored when cached? in the filesystem? db is not hit but server still needs to retrieve it from somewhere. where is it being fetched from?

  • @MorkorOuzor
    @MorkorOuzor 10 місяців тому

    I'm still discovering Remix theorically so probably i'll discover the answer to this, but for now, I'm wondering, I thought the loader data was streamed with everything else, but it looks like not in your example.
    If it is streamed, sometimes, so shared between many loaders / pages, how would the cache headers apply to the global response ?
    Thx

  • @v1d300
    @v1d300 10 місяців тому +1

    These are some lovely patterns, using the web standards wherever possible.
    P.S.: For max-age, N is definitely seconds and not minutes. I think you got that mixed up so you got so confused?

  • @eiley1336
    @eiley1336 10 місяців тому

    If you wanted to invalidate the cache before the expiration time, u could do it with sse? Maybe sending a event to the client and telling it to revalidate the data? And with that caching new data for the other users with the cache layer?

    • @yanndinendal
      @yanndinendal 10 місяців тому

      You can use a very short `max-age` in addition to a longer `stale-while-revalidate`, so the browser and/or cache server, proxy server, CDN, etc will answer instantaneously with the cached response, while refetching in parallel a fresh version for the next visitor or request. :)

  • @nickbreaton
    @nickbreaton 10 місяців тому

    Will this continue to work with the single fetch proposal?
    What if some loaders on the route return user data but others return static content like here. Would the cache control header get applied to the entire response?

    • @nickbreaton
      @nickbreaton 10 місяців тому

      Using user data as an example as I was thinking from a CDN cache layer.
      But for a local browser cache even I’d be worried about stale data from other loaders.

  • @odra873
    @odra873 10 місяців тому +2

    atm machine