massive optimizations for https