optimized mirroring of files on insert
fixed usage of application object in WSGI mode