JBStrap Page cache

JBStrap offers a unique feature: when navigating the application, the status and contents of previously visited pages are not lost. This feature is called the PageCache.

If you open a new page, the previously opened one will be removed from HTML DOM. Its class on the client-side will be removed as well. If you open the page again, it will be reset to its default state. In some cases, this is not a feasible option. Such an example is having a page with a ListGrid component, and selecting an entry for editing. If users double-click on the entry, an editor window appears to them. Users edit the entry, and in the default case, they are redirected to the top of the list after they close the editor. Then they have to scroll down to the previously edited entry.

To avoid this, and to provide additional quality improvements, JBStrap offers its PageCache navigation solution. If you open a page using PageCache, the page will not be removed from HTML DOM, and the client-side page will also remain. In the above-mentioned example, this means that the ListGrid page will only be hidden temporarily, so it may be reopened later in the same state.

Opening a page using the PageCache

To stick with the previous example, if you open the editing page like this, it will appear the same. Users are allowed to edit it. However, the list page will not be deleted from the memory, and it won’t change when being edited.

Closing a page

After editing and closing the page, the user will be navigated back to the previous page stored in the PageCache (in this case, to the page where the editor is opened). Since the page isn’t rebuilt, but only made visible again, the page remains in its previous state.

If you open multiple pages using the PageCache, the page closing method will always close the last page, and will always display the previous page. If you close every page, and there are no other pages in the cache, the user is navigated to the application’s entry point. This entry point can be specified in the ENTRY_POINT parameter.

If you use the PageCache solution, and you navigate back without closing the page (using regular navigation), the PageCache will be emptied as well. In this case, every page is removed from the cache, and you won’t be able to display them again unless you use the regular navigation method.