Cache Control in Remix Loaders

  Рет қаралды 5,264

Remix

Remix

Күн бұрын

Learn how to easily optimize subsequent requests to the same page by adding a Cache Control headers to Remix Loaders.
Play with this demo 👉 remix-movies.pages.dev/
Checkout the code 👉 github.com/remix-run/example-...
00:00 - Navigations with cache control
01:28 - Adding Cache Control to the Loader
03:10 - Previewing the site with Cache Control
Learn more at remix.run

Пікірлер: 15
@user-wb2nn4fy4q
@user-wb2nn4fy4q 4 ай бұрын
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! 🙌
@v1d300
@v1d300 5 ай бұрын
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?
@rahmatsulistio
@rahmatsulistio 5 ай бұрын
Can you make a tutorial about the best practice for filtering and pagination for admin pages?
@RogerStudner
@RogerStudner Ай бұрын
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 5 ай бұрын
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?
@eiley1336
@eiley1336 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
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.
@jimshtepa5423
@jimshtepa5423 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
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 3 ай бұрын
He discussed how this can be used on the CDN layer @5:12
@MorkorOuzor
@MorkorOuzor 5 ай бұрын
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
@odra873
@odra873 5 ай бұрын
atm machine
Persistent Managed Caches with Remix Client Loader
9:21
Prefetching Links in Remix
10:29
Remix
Рет қаралды 5 М.
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 62 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 79 МЛН
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 61 МЛН
Searching IndexedDB in Remix
18:22
Remix
Рет қаралды 6 М.
Caching Data in Memory with Remix Client Loaders
9:15
Remix
Рет қаралды 8 М.
Cookies in Remix
13:19
Remix
Рет қаралды 9 М.
The mathematically impossible ball that shouldn’t exist.
19:29
Stand-up Maths
Рет қаралды 315 М.
I might be enjoying Remix more than Next
11:02
Web Dev Cody
Рет қаралды 27 М.
Deferring Data + Streaming in Remix
14:32
Remix
Рет қаралды 12 М.
The Unreasonable Effectiveness Of Plain Text
14:37
No Boilerplate
Рет қаралды 589 М.
Differences between Form vs. Fetcher in Remix.run
3:02
Daniel Kanem
Рет қаралды 816
How Remix solved React’s client state management problem
6:08
Thomas Gauvin
Рет қаралды 10 М.
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 6 МЛН
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 1,2 МЛН