Get Last Node Access Timestamp Per Node by User Drupal 8.x

I am trying to compare the current users last access timestamp to other timestamp values and am wondering how to get the current users "last_access" in HOOK_preprocess_node().

MYMODULE.module:

function MYMODULE_preprocess_node(&amp;$variables) {
  kpr(\Drupal::currentUser()-&gt;getLastAccessedTime());
}


This returns a timestamp, however, it updates quite infrequently and not on node load, or even after cache clear, and does not seem node specific.

I've accessed this value in HOOK_preprocess_user() with $variables['elements']['#user']-&gt;access-&gt;value, however, I would like the same value available in node.

How do you get the timestamp of the user's last view of a node per node?
This doesn't work because the node is cached. Disabling caching of the node wouldn't be a good idea, performance-wise. Try instead a lazy builder to retrieve the access time and create a placeholder, so that the node can be cached, no matter how often the access time is updated:
/**
 * Implements hook_preprocess_HOOK() for node templates.
 */
function mymodule_preprocess_node(&amp;$variables) {
  $variables['content']['timestamp'] = [
    '#lazy_builder' =&gt; ['mymodule_timestamp_current_user', []],
    '#create_placeholder' =&gt; TRUE,
  ];
}

/**
 * #lazy_builder callback; builds timestamp markup with current user access time.
 */
function mymodule_timestamp_current_user() {
  $timestamp = \Drupal::currentUser()-&gt;getLastAccessedTime();
  return [
    '#markup' =&gt; $timestamp,
    '#cache' =&gt; ['max-age' =&gt; 0],
  ];
}

Drupal ^9: The callback needs to be in a class implementing TrustedCallbackInterface or RenderCallbackInterface. See https://drupal.stackexchange.com/a/303039/47547 for a code example.

Statistics
This code extends the code you had so far. If you are referring to statistical node view data have a look at the core Statistics module, which provides a timestamp when the node was last viewed. However, not on a per user basis, but this gives you an idea how you can record such statistical data.