global variable, cache or other way to pass variable from beforeUpdate to afterUpdate

What way should be used to pass some variable from beforeUpdate handler to afterUpdate handler (for the same table record update action) for already deployed javascript servercode?
This approaches dont make any effect in this mode:

global.my_variable = someobj; 

or

Backendless.Cache.put( "my_variable", someObject, 20).then(() => {}) // in beforeUpdate
Backendless.Cache.get( "my_variable").then(itemCashResult => {}) // in afterUpdate

But both work in debug mode (cause of local environment). I was forced to make some custom Cache data table to use some variable passing, but it is not the best performance solution. I’d like to make it in correct way if such exist.
Thank You!

Thank you, Vitaly . Now it works, before I had behavior like handler and request had stuck as penging.

Hi Yury

The Backendless.Cache should work for the code deployed into the CLOUD.
Just try to increase the timeToLive value.