anchor.diff:                  Fun when is_function(Fun, 1) -> Fun(Client);
                   DataJSONMap -> DataJSONMap
               end,
  -            {append_gri(ReqGRI, ResGRI, Result), PayloadCache#{ResGRI => TranslateResult}}
  +            % Cache the translator result for faster consecutive calls
  +            {insert_gri(ReqGRI, ResGRI, Result), PayloadCache#{ResGRI => TranslateResult}}
       end.
   
   
   %%--------------------------------------------------------------------
   %% @private
   %% @doc
  -%% Check if auto scope was requested - in this case override it in result.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec append_gri(RequestedGRI :: gs_protocol:gri(), ResultGRI :: gs_protocol:gri(),
  +%% Inserts the "gri" field in the result. Checks if auto scope was
  +%% requested - in this case overrides the scope in result to auto.
  +%% @end
  +%%--------------------------------------------------------------------
  +-spec insert_gri(RequestedGRI :: gs_protocol:gri(), ResultGRI :: gs_protocol:gri(),
       gs_protocol:data()) -> gs_protocol:data().
  -append_gri(#gri{scope = auto}, ResultGRI, Data) ->
  +insert_gri(#gri{scope = auto}, ResultGRI, Data) ->
       Data#{<<"gri">> => gs_protocol:gri_to_string(ResultGRI#gri{scope = auto})};
  -append_gri(_RequestedGRI, ResultGRI, Data) ->
  +insert_gri(_RequestedGRI, ResultGRI, Data) ->
       Data#{<<"gri">> => gs_protocol:gri_to_string(ResultGRI)}.
   
   
  
positive.code:         Result -> Result
      end,
      %% GRI must be sent back with every GET response
      append_gri(RequestedGRI, ResultGRI, Resp).
  
  
  -spec updated_payload(ReqGRI :: gs_protocol:gri(), ResGRI :: gs_protocol:gri(),
      translator(), gs_protocol:protocol_version(), gs_protocol:client(),
      gs_protocol:entity(), payload_cache()) -> payload_cache().
  updated_payload(ReqGRI, ResGRI, Translator, ProtoVer, Client, Entity, PayloadCache) ->
      case maps:find(ResGRI, PayloadCache) of
          {ok, Fun} when is_function(Fun, 1) ->
              {append_gri(ReqGRI, ResGRI, Fun(Client)), PayloadCache};
          {ok, Data} ->
              {append_gri(ReqGRI, ResGRI, Data), PayloadCache};
          _ ->
              {ok, Data} = ?GS_LOGIC_PLUGIN:handle_graph_request(
                  ?GS_LOGIC_PLUGIN:root_client(), undefined, ResGRI, get, #{}, Entity
  
negative.code: %% Simple cache used to remember calculated payloads per GRI and limit the
  %% number of requests to GS_LOGIC_PLUGIN when there is a lot of subscribers
  %% for the same records.
  -type payload_cache() :: #{gs_protocol:gri() => gs_protocol:data()}.
  
  
  %% API
  