Revert "Fix for non working mem cache  from master"

This reverts commit 0e2560abb7805fca78f320154ff8eda4c69307c7.