@alexdotjs
Alex / KATT 🐱
3 months
is this the way to globally disable caching in @nextjs ? (I find automatically enabled caching too scary to use)
Tweet media one
17
9
160

Replies

@alexdotjs
Alex / KATT 🐱
3 months
@alexdotjs
Alex / KATT 🐱
3 months
I think I might've been unnecessarily anxious about this. Any call to `cookies()` - which all private stuff depends on - automatically opts nextjs out of the caching
6
1
62
0
0
2
@tshddx
Thomas Shaddox
3 months
@alexdotjs @nextjs From what I’ve seen, you have to put that on *every* route module.
1
0
2
@alexdotjs
Alex / KATT 🐱
3 months
@tshddx @nextjs if that's true I ain't migrating
2
0
18
@imanthonyholmes
Anthony Holmes
3 months
1
0
2
@alexdotjs
Alex / KATT 🐱
3 months
@alexdotjs
Alex / KATT 🐱
3 months
@tomaszferens @nextjs @remix_run ok brb migrating hundreds of thousands lines of code to a completely different framework
1
0
4
2
0
14
@oljimenez
Oscar Luis Jiménez
3 months
@alexdotjs @nextjs Yeah, in my exp you have to put "force-dynamic" or "force-static" depending of if you want static vs dynamic content. I found automatic detection a pretty bad DX for now. Maybe it could work nice with PPR.
1
0
6
@lucashfrsantos
Lucas Santos @DuskyDots
3 months
@alexdotjs @nextjs yeah - unfortunately, it's painful. I still don't understand why can't they do a better API design/similar as react query do - do not modify the way I fetch data, instead give me the tools to cache it properly, see more:
Tweet media one
1
0
1
@TkDodo
Dominik 🔮
3 months
@alexdotjs @nextjs there are four different caches and this only disables a couple of them afaik 🙈
1
0
35
@jonkkillian
Jon Kurtis ⚡
3 months
@alexdotjs @nextjs this would work. but i think it does not allow you to force dynamic at a lower level. Gonna hit those Vercel function limits quick!
0
0
0
@phry
Lenz Weber-Tronic
3 months
@alexdotjs @nextjs You need it in every page, but yes.
0
0
1
@Jalvarado91
Juan Alvarado
3 months
@alexdotjs @nextjs I just put it on every page in case tthe router is trying to be too clever
0
0
3
@edgarasben
Edgaras
3 months
@alexdotjs @nextjs Wonder if you put that in middleware 🤔
0
0
1
@LucaForstner
Luca Forstner
3 months
@alexdotjs @nextjs I think you need to add it to every server file.
0
0
2
@tomaszferens
Tomasz Ferens
3 months
@alexdotjs @nextjs This will opt in into dynamic mode. Unfortunately you will still run into router (client) cache that invalidates every 30 seconds (for dynamically generated pages) - to fix this you will need to heavily rely on revalidatePath or revalidateTag or router.refresh.
1
0
3
@iMBitcoinB
Reetesh Virous₿ (GRT👨🏻‍🚀)⚡️
3 months
0
0
0
@kajtszy
Kajetan Szymczak
3 months
@alexdotjs @nextjs I did little helper for NextJS data cache (tags or revalidate) which might help in some cases
0
0
8
@myothercoolname
aidrian
3 months
@alexdotjs @nextjs // <YOU_CANT_FIRE_ME_I_QUIT>
0
0
0
@asilvadesigns
Alberto Silva
3 months
@alexdotjs @nextjs idk, but when I use it, it makes the red go away
0
0
0
@igarshmyb
rong-sen-e/acc
3 months
0
0
0