reduce the number of Lua append calls when writing the response