added ssl caching logic