Тёмный

Speed Up Your Apps with Cache Control 

Huntabyte
Подписаться 24 тыс.
Просмотров 19 тыс.
50% 1

If you find my content useful and want to support the channel, consider contributing a coffee ☕: hbyt.us/coffee
This video is meant to serve as an introduction to caching API responses and load functions with SvelteKit & Redis. I'm aware that there is a lot more to caching than what I cover in this video, so if you are interested in learning more about different caching strategies, please let me know in the comments!
📁 Source Code: github.com/huntabyte/svelteki...
Free Redis Cloud Instance: app.redislabs.com/#/login
ioredis: github.com/luin/ioredis
🚀 Become a channel member: hbyt.us/join
💬 Discord: hbyt.us/discord
🐦 Twitter: hbyt.us/twitter
🖥️ Setup Stuff: hbyt.us/gear
📃 Topics Covered:
- SvelteKit SSR
- SvelteKit Loading Data
- SvelteKIt Load Functions
- SvelteKit Data Fetching
- SvelteKit speed
- SvelteKit performance
- SvelteKit Server Load
- SvelteKit Cache
- SvelteKit Caching Data
- Caching SvelteKit
- SvelteKit Redis
- Redis SvelteKit
__________________________________________
(Affiliate links may be included in this description. If you choose to purchase a product from one of those links, I may receive a small commission at no cost to you. Thank you for supporting the channel!)

Опубликовано:

 

24 янв 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 62   
@Huntabyte
@Huntabyte Год назад
I'm aware that there is a lot more to caching than what I cover in this video, so if you have any tips, I'd love to hear them!
@Palundrium
@Palundrium Год назад
Related, but if anybody is looking for a simple caching solution without the overhead or dependency on redis, the `lru-cache` NPM package is a solid bet. 😄 Important note: it uses whatever memory is serving your Node app (within set limits) to cache most recently used values (i.e. it typically evicts "Least Recently Used" values at a set limit). And it was created by the creator of NPM.
@Huntabyte
@Huntabyte Год назад
@@Palundrium for sure a great option if you aren’t deploying the app to vercel or similar serverless platform!
@Shaparder
@Shaparder Год назад
I know your numbers arent that big, but I swear never stop making these, you're incredible at explaining concept, and the live demonstration is always on point ! Ill never stop supporting this channel, keep going man
@Huntabyte
@Huntabyte Год назад
Thank you! I don’t do it for the numbers, nor do I see myself stopping anytime soon 💯
@Loui3Hunna
@Loui3Hunna Год назад
Thank you so much for taking the extra time to make illustrations for the concepts in your videos. It makes learning and implementing them feel so much more natural
@Huntabyte
@Huntabyte Год назад
You're very welcome!
@blur3d
@blur3d Год назад
Really solid educator and high level screencast quality. You really help make topics easy to digest and actionable with practical examples with code. Thanks!
@Huntabyte
@Huntabyte Год назад
Thank you! That means a lot!
@magicalmonke
@magicalmonke Год назад
finally a sveltekit redis tutorial! great video
@Huntabyte
@Huntabyte Год назад
Thank you!
@ygdiget4119
@ygdiget4119 Год назад
I've been wanting a video like this for months! Thank you so much Hunter!!
@Huntabyte
@Huntabyte Год назад
You’re welcome!!
@Allformyequine
@Allformyequine Год назад
Well done again! I REALLY appreciate the time you took to make the Excalidraw blackboard drawings; I think that is the best explanation for caching I've ever seen, and the drawings really help; to be able to show that visually is just wonderful! Thank you!! I learned something 😎😎!
@Huntabyte
@Huntabyte Год назад
That's amazing to hear! You're very welcome!
@manuelalejandrosaezpalomin3904
@manuelalejandrosaezpalomin3904 11 месяцев назад
Awesome work! Thanks for explaining these concept so clear. 🙌
@budivoogt491
@budivoogt491 3 месяца назад
Great explanation. Wasn't familiar with Redis' benefits before but this elucidated them well.
@imho7992
@imho7992 Год назад
Another great vid Hunter, great stuff!
@Huntabyte
@Huntabyte Год назад
Thank you!
@skullyonutube
@skullyonutube Год назад
Mate, this is excellent 👍. I am rebuilding an old Jekyll site into a sveltekit site. The site can hit 1million page loads in a day, fetching data from a headless CMS. Even though they say requests that hit the cached API are not counted it might be worth it to have redis in front of the graphql API. So as a first time sveltekit project for me, your videos have been super useful!
@Huntabyte
@Huntabyte Год назад
Thank you, David! I'm glad to hear that!
@itswadesh
@itswadesh Год назад
Thank you so much for this, we really need more. Cache is the most tricky to handle. Even I don't understand why Sveltekit throws error when I use 2 cacheControl header in 2 separate pages.
@RonaldNababan
@RonaldNababan Год назад
I have been looking for this, thank you
@Huntabyte
@Huntabyte Год назад
You’re welcome!
@rabbitMuncher1
@rabbitMuncher1 Год назад
Good video. Very well explained 😁
@Huntabyte
@Huntabyte Год назад
Thank you, Simon!
@RRits57
@RRits57 Год назад
Quality content, keep it up
@Huntabyte
@Huntabyte Год назад
Thank you, will do!
@Saad-ou3ss
@Saad-ou3ss Год назад
Great video.
@Huntabyte
@Huntabyte Год назад
Thank you, Saad!
@albinsjolin649
@albinsjolin649 Год назад
Dude you are a god
@Huntabyte
@Huntabyte Год назад
Thank you!
@ManoharMaharshi
@ManoharMaharshi Год назад
Tq, but it would be great if you could make a full stack project-based video series covering these latest and greatest tools.
@paivagabriel
@paivagabriel Год назад
Thanks for another great content, Hunter! Looking forward to your course covering all the technologies you use (Svelte/SvelteKit, Typescript/ZOD, Supabase, TailwindCSS, Redis, Stripe, etc) to build a full stack app. Is it coming any time soon? 😅
@Huntabyte
@Huntabyte Год назад
Thank you! Yes, soon enough!
@paivagabriel
@paivagabriel Год назад
@@Huntabyte 🙌🏼🙌🏼. Waiting for it!
@CrimeBeanus
@CrimeBeanus Год назад
tyvm
@Huntabyte
@Huntabyte Год назад
You're very welcome!
@ecasilla01
@ecasilla01 Год назад
A Part 2 of this great video can be a 3rd iteration where you can show cache stampede protection 😅
@abekaj
@abekaj Год назад
Love your videos, thanks for making them! I'm working on a SvelteKit app where multiple routes have their own +page.server.ts with API fetching. Could you possibly explain how to cache across these routes so the API result is stored as the users moves between routes? Perhaps using stores and with/without cache-control?
@Huntabyte
@Huntabyte Год назад
You can use a layout load function for that!
@rafael_tg
@rafael_tg Год назад
Thanks for the excellent videos. What about Vercel ISR? Do you have a tutorial about it ?
@Huntabyte
@Huntabyte Год назад
No but this seems like a good idea to make one!
@tiagostit6
@tiagostit6 Год назад
How I would make SvelteKit revalidate the data in a set amount of time?
@JahirAlam
@JahirAlam Год назад
Great video Do we need redis if we use cloudflare pages ?
@Huntabyte
@Huntabyte Год назад
I need to look into Cloudflare a bit more before I can provide an accurate answer, I know their technology is amazing, I just haven't had the time to learn!
@scott_itall8638
@scott_itall8638 Год назад
just using the setHeaders, nothing from my load appears in the network, setting max=age has zero affect it always fetches.
@LyroPac
@LyroPac Год назад
Hello man, great video. At 14:17 we can see the or the server logged an error. I do often get that kind of error message where the parameters is replaced by something different, do you know how to fixed it?
@casper5314
@casper5314 Год назад
Hi, I have a problem with 'vite dev' It will not load the page anymore after 5 seconds. it will load forever and nothing happens
@raihanhossain3423
@raihanhossain3423 Год назад
For Scenario 3 : Will it be more faster!? (in your code ) when data get from the server first- async function will send data to the client, after that second - it will set/send data to redis
@Huntabyte
@Huntabyte Год назад
For the next user that requests that same dataset, yes!
@raihanhossain3423
@raihanhossain3423 Год назад
@@Huntabyte no I said you sending redis first then client. what if you send client in a separate async function and then redis.
@Huntabyte
@Huntabyte Год назад
@@raihanhossain3423 Oh, yes, you could even do a promise.all() or something of that sort! Good catch!
@ChrisJaydenBeats
@ChrisJaydenBeats Год назад
Take a look at Upstash. They make serverless Redis stupid simple 👏
@nayandeepyadav8790
@nayandeepyadav8790 21 день назад
why not write data to servers disk, that would be faster than api call to redis to get the data
@victordvickie
@victordvickie Год назад
make a video on how to make sveltekit webapp to a mobile app using capacitorjs or webview etc..
@tarsisiushp
@tarsisiushp Год назад
sveltekit and firebase pleasee
@raph151515
@raph151515 Год назад
isn't it more straight forward to write : redis.set(q, await res.text(),"EX",600); why parsing + stringifying when you can just take the string. I hope the browser is keeping the text() value after json() have been called which means calling text() is cheap
@Huntabyte
@Huntabyte Год назад
Good point! I actually haven't tried that, but if you do and it works as expected, let me know!
@meaningmean
@meaningmean Год назад
Love the diagrams
@Huntabyte
@Huntabyte Год назад
Glad you do!
Далее
SvelteKit Authentication with Lucia & Prisma
23:46
Просмотров 48 тыс.
Svelte 5's Secret Weapon: Classes + Context
18:14
Просмотров 14 тыс.
😱КТО БУДЕТ ЛЕДИ БАГ А4⁉️ #а4
00:50
Svelte 5 Surprised Me
6:06
Просмотров 65 тыс.
Adding a cache is not as simple as it may seem...
13:29
3 ways to reduce the size of your docker images
17:20
Protect SvelteKit Routes with Hooks
21:10
Просмотров 55 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 345 тыс.
40 APIs Every Developer Should Use (in 12 minutes)
12:23
Practical Svelte 5 - Shopping Cart
25:10
Просмотров 12 тыс.
Why Your Load Functions are Slow
8:24
Просмотров 20 тыс.