0 content-length means empty file, not chunked
Don't use replace but addAfter+remove so that first frame is not lost, close #471