When I am at the HomePage, my cart is empty. So I add a product to cart and then i go to product page. when i hit the back button to back to Home Page, cart liquid now is empty. But when i reload, cart liquid has 1 item.
I’ll make an assumption on what is happening based on what I saw in the video.
The sidebar is created with Liquid
Adding something to the cart doesn’t change the Liquid - it’s done post load
Moving to another page, and then back will load the browser cached version. Remember that it didn’t have anything in it to start with, and when adding it didn’t change the Liquid.
So really extra code should exist on the site to use JS to also check the current cart status. If there’s items in the cart, use JS to populate the sidebar just like it did when adding to the cart.