-
I've implemented a flop table with search, pagination and sort. All works smoothly and now I'd like to improve performance in the case when I go from individual record back to the listing. Here is the flow: Going from the list to the entry - 1us, but back. - 850us The question, how can I improve the step 3? Maybe some setting exists or built-in cache option or tracking the very first table view? See the gif. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That's more of a LiveView question than a Flop question. Flop does not have built-in caching capabilities. If index and show are in the same LiveView, the items should still be assigned to the socket when you patch back to index. You could check whether you already have items for the given parameters assigned to the socket in |
Beta Was this translation helpful? Give feedback.
-
I have index and show in separate liveviews, (generated with the standard Phoenix generators). I'll check this one out. Thanks. |
Beta Was this translation helpful? Give feedback.
That's more of a LiveView question than a Flop question. Flop does not have built-in caching capabilities. If index and show are in the same LiveView, the items should still be assigned to the socket when you patch back to index. You could check whether you already have items for the given parameters assigned to the socket in
handle_params
and only fetch them from the DB if necessary.