Full page caching cause some weird situations4 users found helpful
I do have a site which has a decent amount of custom coding. i.e. in header.php it has some custom code to show whether a user is logged in or not. If not, it shows welcome guest & some normal cms links. but if a user is logged in, it shows user info, logout link, some important page links, create blog links and many more.
Everything seems to be working fine if I disabled the full page caching. But if it is enabled then the problem occurs.
Here is the scenario: Suppose I'm logged in and navigate to another page, the header shows the non logged in links. But the session doesn't expires as if I refresh the page, it shows the logged in info. Same thing happened for other pages.
Note: I'm 100% sure about the coding, its absolutely okay. no bug is there.
is there a way to solve this. If I disable the cache, the loading time will increase which I won't let it happen.
Please help me.
This thread also touches on the full page cache, but is more concerned with the block cache
Similar stuff, such as pagination and other dynamic elements, are known not to work with full caching enabled. It's not a bug, just a behavior thing.
Enable full caching wherever the blocks on the page allow it, not in all cases.
Try to create a block from it.
PS: kinda funny to use the term "static PHP code" :)
And sorry for the typo, its more likely Hard coded rather static, :)