I'm using MiniProfiler in a Sitecore project. I've set up MiniProfiler to ignore a bunch of sitecore specific paths, including /sitecore/
.
I left the page open for a while and after refreshing I see a bunch of entries on /sitecore/service/keepalive.aspx
:
How can I get MiniProfiler to ignore /sitecore/service/keepalive.aspx
?
How can I test that it's being ignored properly?
For reference, here's the relevant part of the Global.asax.cs
file:
protected void Application_Start(object sender, EventArgs e)
{
InitMiniProfilerSettings();
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
MiniProfiler.Start();
}
protected void Application_EndRequest(object sender, EventArgs e)
{
MiniProfiler.Stop();
}
private static void InitMiniProfilerSettings()
{
MiniProfiler.Settings.IgnoredPaths =
MiniProfiler.Settings.IgnoredPaths
.Append(
"WebResource.axd",
"/Styles/",
".axd",
".xml",
".mp3",
".flv",
".js",
".css",
".gif",
".png",
".jpg",
".woff",
".ttf",
"sc_mode=edit",
"~/media",
"-/media",
"~/icon",
"/sitecore/"
)
.ToArray();
}
Append
is an extension method that concatenates the parameters on the provided enumerable.
/sitecore/service/keepalive.aspx
directly is sufficient./sitecore/service/keepalive.aspx
in MiniProfiler. The other one is aboutApplication_Start
not being hit. The root problem of these two questions may be the same, but the questions themselves are not the same.Application_Start
was never running, which is where myIgnoredPaths
setting was supposed to be set. The fact that miniprofiler was failing was a red herring to the underlying issue thatApplication_Start
was not running, and therefor "This question already has an answer" on the linked question as per the duplicate close reason. There is no answer that can be provided to this question that would not be better suited on the linked question.