If a page is loaded in the cache, and you navigate to another page, and then back to that original page (but with an anchor), it is treated as a new page and not pulled from the cache.
For example, if you're on /derp, then navigate to /herp, then navigate to /derp#anchor, a whole new page will be retrieved from the server instead of pulling from the cache (there is no instant navigation like you'd expect from the cache).
If a page is loaded in the cache, and you navigate to another page, and then back to that original page (but with an anchor), it is treated as a new page and not pulled from the cache.
For example, if you're on /derp, then navigate to /herp, then navigate to /derp#anchor, a whole new page will be retrieved from the server instead of pulling from the cache (there is no instant navigation like you'd expect from the cache).