Browser caching after login / logout

I have a website with a basic entry / exit system.

When I display the pages, I check to see when the last page was changed, and if the browser sent an if message, changed from the header. If it has not been changed , I send the header 304and exit.

This explicitly loads the page much faster and means less memory and processing power for me, since I don't need to create page content.

However, I found that if the user logs in and then views the unmodified page, he still sees the login button, the same is true if he logs out and views the modified page, he will see the option logout.

It seems like this would be a common occurrence for anyone who wants to use the 304unmodified headers, but I'm struggling to find any discussion on how to solve it.

Any help would be greatly appreciated (I understand that I did not give a lot of information, but I'm not sure what else to say this is quite explanatory)

+3
source share

Source: https://habr.com/ru/post/1760266/


All Articles