drupal cache menu

jlechuga's picture
jlechuga
Wed, 12/12/2018 - 17:50
#1
drupal cache menu

Is there a quick way to make it so Drupal does not cache the menu or module menu links? either through hooks or php.

any help with this is greatly appreciated.

cindy's picture
cindy
Wed, 12/12/2018 - 23:11

Hello

which version of megamenu are you using? for Drupal7 or drupal8?

The cache problem is at back end or front end?
Please send us some screenshot with more explaination

jlechuga's picture
jlechuga
Thu, 12/13/2018 - 10:00

We are passing through some buttons that need to be accessible from select IP's. We have the logic that checks for the user ip and shows the buttons. However we are noticing that once the buttons show for one user they show for all users. When we turn off Drupal 8 cache the issue is resolved and nav buttons show properly based on users ip. And that is why we are trying to see if there is a way to prevent drupal from cache the megamenu or menu block. Any help would be greatly appreciated. 

Thank you

cindy's picture
cindy
Fri, 12/14/2018 - 05:44

Hello,

We are not very clear about the way you add buttons => block megamenu. Yet, you can prevent drupal from cache for the megamenu or menu block by following this instruction: 

search function md_megamenu_preprocess_md_megamenu in file md_megamenu.module
and add: 

$variables['#cache']['max-age'] = 0;

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.