Currently, I am in the process of developing a hybrid mobile app using a Single Page Application (SPA) structure with AngularJS. In order to navigate through different pages within the app, I am utilizing routes and transitions (using Angular directives such as ng-enter and ng-leave).
However, I have encountered an issue when users attempt to go back within the application. It is not always possible to use window.history.back as the previous page may not necessarily be the intended destination for the back button. Thus, I need to programmatically change the route to the correct location.
Users are typically willing to wait for a new page to load when they click on an item that leads to another page. However, the same cannot be said when users tap the back button. The transition to the previous page takes some time to render, giving the impression that the app has frozen. As a result, users often try tapping the back button multiple times out of frustration.
I am curious to know if there is a way to cache elements of the page that have already been rendered in memory. This could potentially speed up the process of navigating back within the application.
P.S.: I am aware that implementing such a solution would require careful monitoring of memory consumption to avoid leaks or excessive resource usage which could further slow down the application.