Added little optimization for cache

Write with zero offset case