ZSS-451:
 * modify cache update and make cached range stay rectangle
 * add test case