I am fine with Araq's solution.
Passing cache table as argument is not an option, because it needs to be updated on every request which is a side effect. Returning a copy of table on every call is not an option either, as its size is 64GB. It is cache of matrices
