Search code examples
cachingdrupal-8

Theme is caching previous user name


We are using CAS to login to our Drupal instance. This is working correctly and displaying the correct user content (blocks etc. based on roles). What is not working correctly is the small snippet in the theme that says welcome . It keeps showing the previous user who logged in.

How do I set this in bigpipe?

The code looks like this in the theme: <span id="user_name">{{user.displayname}}</span>

Is there a way to tell bigpipe not to cache this?

This code snippet is on one of our twig files header.twig.html which is a partial.


Solution

  • I ended up putting this in a block, and just referencing the block section in the theme instead of just pulling that, then I used the block to be ignored for caching.

    Thanks!