http: directly write to tmp file when using logcache