Next.js Discord

Discord Forum

best way to get page views in nextjs app router

Unanswered
North Pacific hake posted this in #help-forum
Open in Discord
Avatar
North Pacific hakeOP
how to do this? many thanks

8 Replies

Avatar
Do Marketing and you will get more page views 🙂
@North Pacific hake
Avatar
@North Pacific hake check out Leerob blog it has a page counter
he uses Postgre to store the page count
Avatar
hey, in my blog I use the following solution, both functions are executed in a component using unstable_noStore so that every time a request is made it is executed, the visits are saved in a redis, here you can see: https://github.com/franfdezmorales/blog/blob/master/app/lib/articles/index.tsx
Avatar
with partial prerendering you can scope the dynamic rendering and side effect to the counter component while keeping the page static
Avatar
thats right, thats how it currently works
Avatar
North Pacific hakeOP
thank you guys. @Eric Burel @fran