Section Navigation Cache Clearing Test Cases - NCIOCPL/cgov-digital-platform GitHub Wiki
Background
The section navigation display rules are complex. They are further complicated by our multiple levels of caching. At a high level, the important things to understand are:
- There are different layers of per environment
- ACE & ODEs have 1 level of caching (Varnish)
- Technically www-dev-ac has akamai but it is probably misconfigured by now.
- ACSF has 2 levels, Varnish & Akamai
- ACE & ODEs have 1 level of caching (Varnish)
- Akamai has approximately 253,000 servers in 137 countries. So just because you hit a server that is showing the correct page, does not mean someone else is seeing it. Heck - you might not even hit the same server the next time you request!
- Web pages are cached, components on those pages are not. So when testing navigation changes you needs to keep in mind that each page within a section drew that section navigation, from scratch, reflecting the state of the content at that point in time when that page was requested.
- So if the code is bad, then you see a proper section nav on one page, but a broken version of that same nav on another page.
- When a web page is cached it stores what are called "cache tags" along with the page. These tags tell Varnish and Akamai what pieces of content the page uses/links to. When content is updated we tell the cache to go clear out anything referencing that piece of edited content.
- NOTE: AND THIS IS IMPORTANT! By default when you edit a page that page is removed from the cache. In fact when you edit a lot of types of content Drupal cleans the items out of the cache. What we have to worry about is cleaning out the right things when WE have implemented custom code that can be cached. (e.g. Site Navigation, Blog Sidebar Items, etc)
- SO, sometimes things look like they worked because a someone edited a page displaying the shared content - However, other pages displaying that content do not update.
- NOTE: AND THIS IS IMPORTANT! By default when you edit a page that page is removed from the cache. In fact when you edit a lot of types of content Drupal cleans the items out of the cache. What we have to worry about is cleaning out the right things when WE have implemented custom code that can be cached. (e.g. Site Navigation, Blog Sidebar Items, etc)
- The *-cms URLs in ACSF bypass the various caches. So if it works in *-cms and not on the web site, all that means is that there are issues with cache clearing.
MAIN TAKEAWAY If you see it working on one page, but something does not work on another, something is probably wrong with the caching. Take detailed notes of the steps and which scenario below you were doing.
Scenarios
Scenario 1
User modifies the pretty url field of a Site Section's landing page
Acceptance Criteria:
- The section navigation (on all pages of that section) display the correct url in the navigation and that link does not result in a 404.
NOTE: Due to not having a good reference manager, if this node is the landing page for any sections outside of the parent section's tree, the requirement cannot be fulfilled.
Scenario 2
User modifies the site section field of a Site Section's landing page
Acceptance Criteria:
- The section navigation (on all pages of the previous parent section) will display the correct url in the navigation and that link does not result in a 404.
- The new page will display the section navigation of the NEW parent
NOTE: Due to not having a good reference manager, if this node is the landing page for any sections outside of the parent section's tree, the requirement cannot be fulfilled.
Scenario 3
User modifies the name of a Site Section with no navigation label set
Acceptance Criteria:
- The section navigation (on all pages of that section) display the correct name in the navigation.
Scenario 4
User modifies the name of a Site Section with a navigation label set
Acceptance Criteria:
- There will be no change to the navigation as a navigation label takes precedence over the name of a site section.
Scenario 5
User adds a navigation label to a Site Section
Acceptance Criteria:
- The section navigation (on all pages of that section) should now display the nav label, just added by the user, in the navigation.
Scenario 6
User modifies a navigation label of a Site Section
Acceptance Criteria:
- The section navigation (on all pages of that section) display the new navigation label, just modified by the user, in the navigation.
Scenario 7
User chooses a new landing page for a Site Section where it currently has one
Acceptance Criteria:
- The section navigation (on all pages of that section) display the correct url in the navigation and that link does not result in a 404.
- NOTE: The displayed text for that navigation item should not change.
Scenario 8
User sets a landing page of a Site Section where it did not have one before
Acceptance Criteria:
- The section navigation (on all pages of that section) should now display the navigation item with the correct url.
- The link does not result in a 404.
Scenario 9
User removes a landing page of a Site Section
Acceptance Criteria:
- The section navigation (on all pages of that section) should no longer display the navigation item.
Scenario 10
User changes the weight (reorders) of a site section through dragging and dropping.
Acceptance Criteria:
- The section navigation (on all pages of that section) should reflect the new order.
Scenario 10B
User changes the weight (reorders) of a site section through the weight field.
Acceptance Criteria:
- The section navigation (on all pages of that section) should reflect the new order.
NOTE: This really depends on what the weight is set to. If two items share the same weight the order may not change at all.
Scenario 11
User sets the Site Section to be a Section nav root
Acceptance Criteria:
- The section navigation that displays on all children of this site section will display the new section navigation.
- NOTE: The previous parent section navigation will not change at all.
Scenario 11
User sets the Site Section to no longer be a Section nav root
Acceptance Criteria:
- The section navigation that displays on all children of this site section will now display the parent section's section navigation.
Scenario 12
User changes the parent of a Site Section, in which the Site Section is not marked Section nav root.
Acceptance Criteria:
- The previous parent's section navigation (and all the other pages within that section) will no longer display the portion of the navigation generated by this Site Section.
- The children of this site section will now display on the new parent's section navigation.
- The navigation items that now appear on the new parent's section navigation will have updated URLs that fall under new parent's URL structure.
NOTE: Due to a bug in updating site sections, this scenario will not work correctly. (All of the URLs in the menu will be incorrect)
Scenario 12B
User changes the parent of a Site Section, in which the Site Section is marked Section nav root.
Acceptance Criteria:
- The previous parent's section navigation (and all the other pages within that section) will no longer display the portion of the navigation generated by this Site Section.
- The children of this site section will now display on the new parent's section navigation.
- The children of this site section will continue to display this items Section navigation, but now display URLs that fall under new parent's URL structure.
- NOTE: The navigation items displayed will be the same as before.
NOTE: Due to a bug in updating site sections, this scenario will not work correctly. (All of the URLs in the menu will be incorrect)
Scenario 13
User changes the Site Section's pretty url
Acceptance Criteria:
- All the pages underneath that site section should have their URLs updated within their corresponding section navigations.
- If a page is the landing page of a totally different site section on the site, outside of this "tree", then that section navigation should be updated too.
NOTE: Due to a bug in updating site sections, this scenario will not work correctly. (All of the URLs in the menu will be incorrect)
NOTE: Due to not having a good reference manager, the second requirement where a page lives in a another section navigation, cannot be fulfilled.
Scenario 14
User unselects "Hide in section nav" on a Site Section (where the site section could appear in nav)
Acceptance Criteria:
- The section, and its applicable children, now will appear in the section nav on all pages of that section)
Scenario 15
User marks a Site Section, that is marked as Section nav root, to "Hide in section nav"
Acceptance Criteria:
- The section, and its applicable children, now will disappear from a parent section's section navigation (on all pages of that section.)
- There will be no change to how the children of the modified section display, as they continue to display the same section navigation.
Scenario 16
User marks a Site Section, that is NOT marked as Section nav root, to "Hide in section nav"
Acceptance Criteria:
- The section, and its children, now will disappear from a parent section's section navigation (on all pages of that section.)
Scenario 17
User changes the number of levels to display of a Site Section that IS marked as Section nav root
Acceptance Criteria:
- More child navigation elements will appear on that section navigation (on all pages of that section.)
Bad Scenarios
- User unselects "Hide in section nav" on a Site Section (where the site section could NOT appear in nav)