Skip to content

Build-time state can be user or "segment" specific, and it's actually easy to setup #295

@eric-burel

Description

@eric-burel

This issue is reporting a bug in the documentation.

  • Documentation version: v0.3.2
  • Documentation source: On the website (book)
    The user described the issue as follows:

Hi,

I wanted to point out an issue regarding Perseus understanding of static/build-time rendering:

"When you generate state at build-time, you're generating it without knowledge of who will be using it. For instance, you can't generate personalized dashboard pages at build-time, because you don't know yet who your users are."

This is similar to what you could have found in Gatsby or Next.js documentation in the past. Despite being a common take, this however never has been true, counter-example are as simple as statically rendering translated content.

User-specific content is of course usually not something you want to do statically (though it's doable, including personalized dashboards), however group specific, or what I call "segment-specific" rendering in the marketing sense of "segment", is totally doable and even a good practice.

You can achieve it very simply by adding a URL redirection/rewriting server in front of your page.

I invite you to read my work on "Segmented Rendering" which describes this pattern:
https://www.smashingmagazine.com/2022/07/new-pattern-jamstack-segmented-rendering/
There are also resources at the bottom with more specific takes (the equivalence between this approach and HTTP caching ; how to scale to multiple parameters with the "megaparam").

Hope this will help in your journey!
Feel free to reach me out at eb@lbke.fr if you want to discuss the subject further
Best regards

Tribble internal data

dHJpYmJsZS1yZXBvcnRlZCxDLWRvY3MsQy1idWcsQS13ZWJzaXRlLWRvY3M=

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-website-docsArea: documentation on the website (book)C-bugCategory: bugC-docsCategory: documentationtribble-reportedThis issue was reported through Tribble.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions