Navigation Bar implementation makes all pages uncacheable

Created on 29 March 2024, 9 months ago
Updated 15 April 2024, 8 months ago

Problem/Motivation

Issue split from 📌 Add tests for UserNavigationBlock Needs work .

The navigation bar implementation has a cache context per user in the global section that can not be placeholdered. This causes the Dynamic page cache to stop working, since the cardinality is too high.

Proposed resolution

Get rid of the context per user in navigation bar.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @plopesc
  • 🇪🇸Spain plopesc Valladolid
  • Pipeline finished with Failed
    9 months ago
    Total: 245s
    #132345
  • 🇪🇸Spain plopesc Valladolid

    As part of the MR creation, commented the line suggested by @m4olivei in 📌 Add tests for UserNavigationBlock Needs work .

    It lead to some broken tests.

    Debugged it a it and found the issue in NavigationBlockCacheTest::testCachePermissions

    Cache tags before the change (Test pass):
    config:block_list config:navigation.navigation_block.administration_menu config:navigation.navigation_block.content_menu config:navigation.navigation_block.oxaw6wfu config:navigation.navigation_block.user config:navigation.settings config:system.menu.admin http_response navigation_block_view rendered user:2 user_view
    Cache tags after the change (Test fails):
    config:block_list config:navigation.navigation_block.administration_menu config:navigation.navigation_block.content_menu config:navigation.navigation_block.user config:navigation.settings config:system.menu.admin http_response navigation_block_view rendered user:2 user_view

    I'm missing the cache tag related to the test navigation block added during setup().

    My feeling is that reason behind failing test is that navigation bar cache tags are not properly invalidated or refreshed when a new navigation block is added.

    More digging in this one will be necessary. I'll try to continue with this next if anybody finds the root cause before.

  • Pipeline finished with Success
    9 months ago
    Total: 196s
    #134136
  • Status changed to Needs review 9 months ago
  • 🇪🇸Spain plopesc Valladolid

    MR created that replaces the problematic user cache context with user.permissions to make the navigation bar cacheable.

    As a secondary effect, we found that cache tags were not being implemented properly because navigation bar was not including automatically new navigation blocks added.

    Root cause seemed to be that navigation block list cache tag (config:navigation_block_list) was not included in the bar itself.

    Once the cache tag is added, tests are back to green and 'X-Drupal-Dynamic-Cache' header is not 'UNCACHEABLE' anymore.

    I believe this is ready for review now!

  • Status changed to RTBC 9 months ago
  • 🇨🇦Canada m4olivei Grimsby, ON

    Great work!

    That all makes logical sense to me. Ran through some tests on Tugboat, and it appears to be working well as well.

  • Pipeline finished with Skipped
    9 months ago
    #134478
  • Pipeline finished with Skipped
    9 months ago
    #134479
  • Status changed to Fixed 9 months ago
  • 🇨🇦Canada m4olivei Grimsby, ON

    Thanks again @plopesc.

    Merged to 1.x

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Success
    7 months ago
    Total: 203s
    #181327
  • Pipeline finished with Success
    6 months ago
    Total: 189s
    #197861
  • Pipeline finished with Failed
    4 months ago
    Total: 401s
    #266047
  • Pipeline finished with Failed
    4 months ago
    #266096
  • Pipeline finished with Failed
    4 months ago
    Total: 458s
    #267248
  • Pipeline finished with Failed
    4 months ago
    Total: 533s
    #273020
  • Pipeline finished with Failed
    4 months ago
    Total: 755s
    #273537
  • Pipeline finished with Failed
    4 months ago
    #273579
  • Pipeline finished with Failed
    4 months ago
    Total: 359s
    #273612
  • Pipeline finished with Failed
    4 months ago
    Total: 440s
    #273789
  • Pipeline finished with Failed
    4 months ago
    Total: 592s
    #273800
  • Pipeline finished with Failed
    4 months ago
    Total: 585s
    #273866
  • Pipeline finished with Failed
    4 months ago
    Total: 456s
    #273879
  • Pipeline finished with Failed
    4 months ago
    Total: 570s
    #273889
  • Pipeline finished with Failed
    4 months ago
    #273924
  • Pipeline finished with Failed
    4 months ago
    #274211
  • Pipeline finished with Failed
    4 months ago
    Total: 370s
    #274221
  • Pipeline finished with Failed
    4 months ago
    Total: 362s
    #274222
  • Pipeline finished with Failed
    4 months ago
    Total: 1166s
    #274470
  • Pipeline finished with Success
    4 months ago
    Total: 371s
    #274681
  • Pipeline finished with Failed
    4 months ago
    #274719
  • Pipeline finished with Failed
    4 months ago
    Total: 450s
    #274765
  • Pipeline finished with Success
    4 months ago
    Total: 471s
    #274773
  • Pipeline finished with Success
    4 months ago
    Total: 743s
    #274789
  • Pipeline finished with Success
    4 months ago
    Total: 480s
    #274907
  • Pipeline finished with Canceled
    4 months ago
    Total: 166s
    #274983
  • Pipeline finished with Success
    4 months ago
    Total: 426s
    #274984
  • Pipeline finished with Failed
    4 months ago
    Total: 485s
    #275434
  • Pipeline finished with Failed
    4 months ago
    Total: 482s
    #275444
  • Pipeline finished with Canceled
    4 months ago
    Total: 105s
    #275472
  • Pipeline finished with Success
    4 months ago
    Total: 443s
    #275473
  • Pipeline finished with Success
    4 months ago
    Total: 454s
    #275484
  • Pipeline finished with Failed
    4 months ago
    Total: 472s
    #275643
  • Pipeline finished with Success
    4 months ago
    Total: 406s
    #275654
  • Pipeline finished with Failed
    3 months ago
    Total: 546s
    #282327
  • Pipeline finished with Failed
    3 months ago
    Total: 347s
    #282415
  • Pipeline finished with Failed
    3 months ago
    #282443
  • Pipeline finished with Success
    3 months ago
    Total: 432s
    #282554
  • Pipeline finished with Canceled
    3 months ago
    Total: 80s
    #282750
  • Pipeline finished with Canceled
    3 months ago
    Total: 84s
    #282751
  • Pipeline finished with Success
    3 months ago
    Total: 345s
    #282753
  • Pipeline finished with Success
    2 months ago
    Total: 138s
    #312407
  • Pipeline finished with Success
    2 months ago
    Total: 145s
    #312411
  • Pipeline finished with Failed
    2 months ago
    Total: 172s
    #315605
  • Pipeline finished with Failed
    about 2 months ago
    Total: 212s
    #322808
  • Pipeline finished with Failed
    about 2 months ago
    Total: 167s
    #323257
  • Pipeline finished with Failed
    about 2 months ago
    Total: 189s
    #323878
Production build 0.71.5 2024