calculate restored+new middleware for legacy shtml