Fix/3.2/issue 1186

Fixed #1186.
Moved near-cache clear process to clear operation. Added basic near-cache test.