write/end caching