public async Task <HttpResponseMessage> GetHomePageInfo() { try { HomePageInfo homePageInfo = await azureSearch.HomePageInfo(); var response = Request.CreateResponse(HttpStatusCode.OK, homePageInfo, Configuration.Formatters.JsonFormatter); #if !NO_CACHE_FOR_TESTING_API response.Headers.CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromDays(1), Public = true }; #endif return(response); } catch (Exception ex) { return(new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(ex.Message) }); } }