Is there any way to cache the data that is loaded in the onGetAsync method? For example, we load data from the database in onGetAsync and bind them to our properties.
I'm wondering if there is a way to keep this data cached/persisted so the onPostAsync method doesn't need to reload all of this and hit the database again. Currently we load the data in the constructor of the PageModel so it gets loaded twice.
For example, we have a remove from cart which removes an item from the shopping cart, so we want to continue showing the shopping cart page so a return Page(); happens but we obviously need to reload all the data which is extremely inefficient.
I'm thinking this might have to happen since we have to update the database with our WriteModel anyway.