1

I made an extension that adds an item to the header navigation if you are within a certain user group. However, because of caching, it wont always show after logging in and wont always go away if you log out.

Is there a way around this? I could disable caching for the block I think but it would cause the page itself to not cache and being that its on every page that would slow down the site dramatically.

4
2

(1) One option could be to create new controller what would return menu item(s) on POST ajax-call and store the result to browser's localStorage.

Call is made only then when there isn't any result yet in localStorage.

(2) Other option is to try builtin private content approach:

In following link has been mentioned that you need to use CustomerData sections for that:

Not the answer you're looking for? Browse other questions tagged or ask your own question.