New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query the primary feed in the background to preload the activities so they can be shown instantly when the user navigates to the feed page #901
Open
1 of 12 tasks
Tracked by
#858
Milestone
Comments
3 tasks
mayel
changed the title
Query the primary feed within the
Query the primary feed in the background to preload the activities so they can be shown instantly when the user navigates to the feed page
Mar 9, 2024
PersistentLive
background LiveView process (which is linked to an individual active user) to preload the activities so they can be shown instantly when the user navigates to the feed page
mayel
added a commit
to bonfire-networks/bonfire_spark
that referenced
this issue
Mar 9, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_social
that referenced
this issue
Mar 9, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_common
that referenced
this issue
Mar 9, 2024
mayel
added a commit
that referenced
this issue
Mar 9, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_common
that referenced
this issue
Mar 9, 2024
mayel
added a commit
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_spark
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_common
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_spark
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_social
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_common
that referenced
this issue
Mar 10, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_social
that referenced
this issue
Mar 11, 2024
mayel
added a commit
to bonfire-networks/bonfire_ui_common
that referenced
this issue
Mar 11, 2024
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That would fetch and cache the activities in a separate elixir process as soon as the user is logged in, to reduce the loading time when showing the feed.
Implementation details
After considering and prototyping several different approaches, it seems like we may have ended up with the most high level optimisation possible (compared to caching DB queries or any steps in between):
Now when signed in to Bonfire, no matter what page you're on you can click to view the feed and it appears instantly (it is already loaded in the background and rendered in a hidden div).
In this way every time you view the feed we avoid using extra resources and time for:
Of course it comes at the cost (especially when a user doesn't end up viewing their feed) of using extra:
And it requires that we fix and extensively test PubSub (see #839) to make new activities appear at top of the feed since user is not reloading it (and it would be even more of a resource waste to simply reload it every minute or whatever)
Still to-do (eg. broken as a result of this refactor)
Stretch goals
The text was updated successfully, but these errors were encountered: