Caching in Nitro 💾

  Рет қаралды 3,455

Alexander Lichter

Alexander Lichter

Күн бұрын

Пікірлер: 50
@mauriceputz
@mauriceputz 2 ай бұрын
Are you reading my mind? Always when I have a project where I need a specific answer video too, I see you uploaded a video to it a few hours or days ago, which nails the topic directly and helps a lot! Thank you mate.
@TheAlexLichter
@TheAlexLichter Ай бұрын
What a timing! Really glad that my content was there right when you needed it 😁
@da-ker
@da-ker 2 ай бұрын
Very nice introduction to caching options. Thank you!
@TheAlexLichter
@TheAlexLichter Ай бұрын
Thanks 🙏🏻
@jdaws47
@jdaws47 2 ай бұрын
Thank you for your videos. They have been a tremendous help on a project I’m working on.
@TheAlexLichter
@TheAlexLichter Ай бұрын
Happy they could help you 🙏🏻
@sludgebucket3042
@sludgebucket3042 2 ай бұрын
I had no idea this was all doable within Nitro, going to set this up asap
@gabrielserejo8379
@gabrielserejo8379 2 ай бұрын
Thanks for the video Alex!
@TheAlexLichter
@TheAlexLichter Ай бұрын
You are welcome 👏🏻
@web-code-maker
@web-code-maker 2 ай бұрын
Всё очень понятно и классно рассказал. Спасибо друг
@DanielLuchin
@DanielLuchin 2 ай бұрын
This is super useful! Thanks
@TheAlexLichter
@TheAlexLichter Ай бұрын
Glad you think so!
@jitxhere
@jitxhere 2 ай бұрын
Wow this is amazing. I have used hono but unjs seems good too..
@TheAlexLichter
@TheAlexLichter Ай бұрын
It really is! Give it a try 🔥
@ralacerda12
@ralacerda12 2 ай бұрын
Amazing video! Nitro keeps blowing my mind on how simple it's to get it running and doing complex stuff. But a question not totally related to the video, but if you build a project like this for nitro (stand alone) and you want to use with an spa (without nuxt or even without vue), how can I get the types from the nitro project? Do I need to setup a monorepo?
@TheAlexLichter
@TheAlexLichter Ай бұрын
Thank you 🙏🏻 Yeah, that's a bit more tricky. I hope I can make a video on that soon
@gro967
@gro967 2 ай бұрын
Used Nitro caching the first time two years ago, was about time someone exposes that to the world :)
@mustafa60x
@mustafa60x 2 ай бұрын
thanks
@TheAlexLichter
@TheAlexLichter Ай бұрын
No problem!
@solvedfyi
@solvedfyi 2 ай бұрын
I suppose if you're gonna keep bringing up stuff super relevant to me I'm just going to have to subscribe
@TheAlexLichter
@TheAlexLichter Ай бұрын
I wouldn't mind that 😛 Thanks for the sub!
@nanaassumadu4997
@nanaassumadu4997 2 ай бұрын
This is awesome
@TheAlexLichter
@TheAlexLichter Ай бұрын
Right? 🙌
@impactsongs
@impactsongs 2 ай бұрын
Greate Alexander! Thank you for the good tutorials. I have a question because i use cache in Nitro alot. How can i access a url parameter or slug inside a Info.server.vue component example. Because if i use useRoute() it is empty. I ask that because when i want to access something function from server i use Nitro and with this i can make a call directly from my server component.
@TheAlexLichter
@TheAlexLichter Ай бұрын
(Answered in the more recent comment, sorry that I missed this one!)
@hbrd
@hbrd 26 күн бұрын
Great video. Do you have any advice on how to set up Nitro endpoint in Nuxt to only request on buildtime (in Nuxt SSR) and then always use the cached response until next deploy (I am using Netlify)? My use case is I have a Nitro endpoint to generate image thumbnails via thumbhash and those obviously never change for a given image. So ideally I would only generate them once on deploy and in production it would use the cached version (indefinitely) until next deploy. I thought of an arbitrary maxAge settings, but doing something like "maxAge: Infinity" seems weird to me. Thank you!
@TheAlexLichter
@TheAlexLichter 26 күн бұрын
Sure! You can also use the prerender route rule for the path 👌
@hbrd
@hbrd 26 күн бұрын
@@TheAlexLichter Thanks for the reply. Prerender as in nitro.prerender or routeRules: { "...": {prerender: true}}? It gets confusing real quick as some of the settings are aliases for Nitro config and some are not. Also, can you set up some sort of a crawler to prerender all found endpoints rather than specifying all paths to images manually?
@TheAlexLichter
@TheAlexLichter 24 күн бұрын
As route rule (2nd option) 👌 Hmm, not sure about the 2nd part. The Nuxt crawler will crawl a lot of the pages when found but maybe it'd be great to have a way to specify/customize this behavior to also add images and similar. How about raising an issue in nuxt/nuxt about that? 😊
@assoftTR
@assoftTR 2 ай бұрын
Next goal rate limiter?
@HEX_CAT
@HEX_CAT 2 ай бұрын
❤❤❤🎉🎉🎉
@paradox3210
@paradox3210 Ай бұрын
Is it possible to use a catch-all route (server/api/[...].ts) and a specific route rule in the config at the same time? I want to cache one particular route (/api/settings) 🤔
@TheAlexLichter
@TheAlexLichter Ай бұрын
Then you'd need a dedicated /api/settings.ts file (which can do the same as the catch-all) - yes.
@LajonDJ
@LajonDJ Ай бұрын
@TheAlexLichter Is there a way to get all caches in a Nitro/Nuxt app? My use case is that I would like to build an admin interface, where you can invalidate caches :)
@TheAlexLichter
@TheAlexLichter Ай бұрын
You certainly can. NuxtHub is also doing that 👌🏻
@LoFiLanes
@LoFiLanes 2 ай бұрын
How to do cache with handler with auth ? if i use const session = await requireUserSession(event) from (Nuxt Auth Utils) inside, it doesn't work ( i use Nuxthub)
@atinux
@atinux 2 ай бұрын
The cache is by-passed if we detect an authenticated request to avoid cross request state pollution.
@LoFiLanes
@LoFiLanes 2 ай бұрын
@@atinux Thank you, so i can't cache ? ( with other way) , i shoud never cache auth request ?
@atinux
@atinux 2 ай бұрын
No you should not cache Auth request. But you can cache functions inside using defineCachedFunction
@LoFiLanes
@LoFiLanes 2 ай бұрын
@@atinux Thank you
@TheAlexLichter
@TheAlexLichter Ай бұрын
Nothing to add here 🔥
@undertale-15075O
@undertale-15075O 2 ай бұрын
Больная тема. Когда внезапно узнали что swr не работает в Netlify
@TheAlexLichter
@TheAlexLichter 2 ай бұрын
That sounds like a bug! Is there an open nitro issue?
@paranoidPhantom
@paranoidPhantom 2 ай бұрын
На vercel вроде порядок
@undertale-15075O
@undertale-15075O 2 ай бұрын
@@paranoidPhantom ну так это одно, а это другое
@DanielLuchin
@DanielLuchin 2 ай бұрын
@@paranoidPhantom на vercel не работает ISR.. Если добавить параметры в Get запрос - они игнорируются :(
@виртуоз_ру
@виртуоз_ру 2 ай бұрын
Хорош 👍
Redirects in Nuxt 3
16:31
Alexander Lichter
Рет қаралды 2,9 М.
Ryan Carniato - SolidJS - SolidStart - DevWorld 2024
28:29
JSWORLD Conference
Рет қаралды 11 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 14 МЛН
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 88 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,5 МЛН
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 872 М.
Why Don't We Have A Laravel For JavaScript?
12:36
Theo - t3․gg
Рет қаралды 106 М.
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 426 М.
BEWARE these Laravel attributes | Real World Laravel
19:10
Sam Lewis
Рет қаралды 4,9 М.
Nikhil Saraf | vinxi: I needed a server | ViteConf 2023
18:09
ViteConf
Рет қаралды 1,3 М.
SolidStart 1.0 First Look: Comparing to React / Next.js
26:20
Solid.js Just Got WAY Better
13:11
Theo - t3․gg
Рет қаралды 84 М.
What is BFF?! (With Nuxt, Nitro and h3)
26:05
Alexander Lichter
Рет қаралды 8 М.
Why node.js is the wrong choice for APIs (and what to use instead)
5:48
DevOps For Developers
Рет қаралды 104 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 14 МЛН