best way to get page views in nextjs app router
Unanswered
North Pacific hake posted this in #help-forum

North Pacific hakeOP
how to do this? many thanks
8 Replies

Do Marketing and you will get more page views 🙂
@North Pacific hake
@North Pacific hake

@North Pacific hake check out Leerob blog it has a page counter
he uses Postgre to store the page count

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

@fran 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

with partial prerendering you can scope the dynamic rendering and side effect to the counter component while keeping the page static

@Eric Burel with partial prerendering you can scope the dynamic rendering and side effect to the counter component while keeping the page static

thats right, thats how it currently works

North Pacific hakeOP
thank you guys. @Eric Burel @fran