Added little optimization for cache

Write with zero offset case
Merge pull request #196 from euroelessar/master

Added little optimization for cache