How to Load Dynamic Per-Request Data on Prerendered Routes with ssr: true? #14001
Unanswered
nikolailehbrink
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You have to use clientLoader for this. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m working on my site, using
ssr: true
andprerender()
to statically generate blog post pages during the build. Everything works great for rendering the blog content itself.However, I want to implement a view counter using a hosted SQLite database (Turso). Ideally, the counter should increment whenever someone visits a blog post. In development this works, but once the blog posts are prerendered in production, the counter obviously no longer updates, since the loader is only used on build time. Ideally I want the content to be there and the view counter to stream it's data in, so there is no blocking behaviour.
What would be the best way to do that?
Beta Was this translation helpful? Give feedback.
All reactions