I use Html.RenderAction<CartController>(c => c.Show());on my main page to display a cart for all pages. The problem is when I add an item to the cart and then remove the back button. It shows the old cart (from the cache) until I click the refresh button or go to another page.
I tried this one and it works fine, but it disables the cache globally for the entire page and for all pages of my site (since this action method is used on the main page). I need to enable the cache for several other partial representations (action methods) for performance reasons.
I would not want to use the client side of the script with AJAX to update the cart (and login) when the page loads - but this is the only solution I can think of right now.
Does anyone know better?
source
share