dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.04k stars 860 forks source link

[Bug] Left nav menu changes not visible after changing TOC.yml, and intermittent loss of sub-menus (until Ctrl-F5 in browser) #8601

Open lanthonyneville opened 1 year ago

lanthonyneville commented 1 year ago

Describe the bug After changing a TOC.yml file (i.e. that controls a left nav menu) and rebuilding the DocFx site (i.e. complete replacement of all HTML files etc with a new set built from source), if a user continues browsing the site, the expected change to the left navigation menu is not seen. If the user reloads a page with "no cache" in browser (e.g. Ctrl-F5), the the change is seen. NOTE: There is one other related issue, but which I cannot reproduce reliably, which is that (also after a rebuild) left nav menus loose their sub-menus (i.e. only top-level links are present) until Ctrl-F5 is pressed.

To Reproduce Steps to reproduce the behavior:

  1. Browse a working DocFx site and load a page with a left nav menu. Example: image

  2. Change the TOC.yml file controlling the left nav menu, e.g. add a new link.

  3. Completely rebuild the site (delete all files and replace with new set built from source)

  4. In the same browser session as used in step 1, refresh the page or browse other pages showing the same left nav. The change is not present. Example: image

  5. Reload the page with "no cache" in browser (e.g. Ctrl-F5). The change is present. image

Expected behavior After a site rebuild, changes to the left nav menus should be seen immediately. Left nav menus should not loose their sub-menus.

Context:

Additional context Using the new modern theme.

lanthonyneville commented 1 year ago

Another observation: sometimes Ctrl-F5 in the browser is not enough to clear whatever is cached in the browser. Today I had to completely clear the Chrome downloaded files & cookies in order to see a new entry in the left nav.