-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Feature]: Retain data cache for parts widgets #33399
Comments
@rennzhang what type of data are you looking to cache? You can use the storeValue function to save data in the local storage. |
Simply put, I hope that the page switch will not re-render the component. I tried some react-route caching solutions, but it didn't work For example, page a has a table component. I enter some query conditions and search for data. Then I jump to page b and return to page a. I hope that page a will not be refreshed, that the data will not be retrieved, and that I will keep the query conditions I entered before. |
@rennzhang that is currently not possible |
@Nikhil-Nandagopal Thank you for your answer. I spent a few days understanding the component rendering mechanism of this project, which is indeed very complex. However, I am not familiar with React enough, so I would like to ask about the general reason |
The general reason is that each page is garbage collected after it's navigated away from to ensure that it doesn't consume memory. Appsmith is generally used for live dashboards where data changes and so it makes sense to fetch the data again. |
I fully understand that it makes sense to have him rerender. Too much caching will cause a lot of memory to consume, and maybe the data state of the component is incorrect... But I still want to ask, if I only make modifications to a few components, such as table and list components, so that it retains data when switching pages, or recovers data from cache, is there any feasible way? I tried to store cached widgetStaticProps here. Judging from the print log, it will initially be applied to the component, but will eventually be overwritten by the original props.
|
@rennzhang I'm not exactly sure of that and you may have better luck asking the team on discord. I don't think there is a simple holistic solution for this and the best way would be for the user to write the logic to cache the state of the widget using storeValue |
Is there an existing issue for this?
Summary
After switching pages, all the data from the previous page will be reloaded. Can we keep the data of all components in the page, similar to react routing caching?
Do you support this feature or help point out where you need to modify it to achieve this effect? I really need this feature, and I would appreciate it if you can provide you with any help
Why should this be worked on?
I developed my application secondary based on appsmith, and I really needed this function
The text was updated successfully, but these errors were encountered: