public void WillUseSameReductionAfterAppPoolRecycle() { var urlPattern = new Regex(@"(href|src)=""?(?<url>[^"" ]+)""?[^ />]+[ />]", RegexOptions.IgnoreCase); new WebClient().DownloadString("http://localhost:8877/Local.html"); WaitToCreateResources(); var response = new WebClient().DownloadString("http://localhost:8877/Local.html"); var css = new CssResource().ResourceRegex.Match(response).ToString(); var js = new JavaScriptResource().ResourceRegex.Match(response).ToString(); var urls = new string[] { urlPattern.Match(css).Groups["url"].Value, urlPattern.Match(js).Groups["url"].Value }; var files = new string[] { urls[0].Replace("/RRContent", rrFolder).Replace("/", "\\"), urls[1].Replace("/RRContent", rrFolder).Replace("/", "\\") }; var createTime = new DateTime[] { new FileInfo(files[0]).LastWriteTime, new FileInfo(files[1]).LastWriteTime }; IntegrationFactHelper.RecyclePool(); new WebClient().DownloadString("http://localhost:8877/Local.html"); WaitToCreateResources(); Assert.Equal(createTime[0], new FileInfo(files[0]).LastWriteTime); Assert.Equal(createTime[1], new FileInfo(files[1]).LastWriteTime); }
public void WillSetCacheHeadersOnJsContent() { var urlPattern = new Regex(@"(href|src)=""?(?<url>[^"" ]+)""?[^ />]+[ />]", RegexOptions.IgnoreCase); string url; using (var client = new WebClient()) { client.DownloadString("http://*****:*****@"""{0}""", uriBuilder.ParseSignature(url)), response2.Headers["ETag"]); response2.Close(); }