Update cache to support $ in storagepath; Redirect http to https when SSL_accept fails and it is plain HTTP requst; Fix compiling issue on MAC and FreeBSD.