• Nioxic@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    How about a setting?

    Have the user choose which one to use.

    I know it could be more work to make… but… i have infinite data on my phone.

    Others may only have 2 gb

    • Cr4yfish@lemmy.worldOPM
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      No, actually. Sorry I should’ve explained more in the post.

      The plan is to always send 2 requests, one with user details (to get upvotes, read posts, bookmarks etc) and the other without any personal data.

      The one with a JWT attached to the requests can’t be server-side cached, since that would be a security risk.

      The one without any personal data can however be cached.

      So when I first do a server render of any page, almost all content will be cached and served instantly. Then I do a client side fetch of the same data, filling in user data such as bookmarked posts for example.

      Effectively, this will make the time until you see posts and stuff much faster.