How to exclude the login state in the front page?

To clarify the original question. I prefer the cache everything for the performance, but it will cache the user’s login information on the page. Refresh doesn’t work. Other user link to the page will also show the same caching page, but this should be the dynamic elements to every single user. Thank you!