Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Performance issues with partial views in CMS

$
0
0

Hi Team,

I am facing lot of performance issues with Partial views in CMS across the application. This issue is happending only for first request and subsequent requests are very quick. Very simple partial action method also taking min 10+ seconds to load for the first time.

First request issue is for all partial views. Lets say, i have two partial views in two different pages so in every page facing this performance issue.

This issue is happening mutiple times in a day.

Below is one sample examples in controller & views to return the partail view:

return PartialView("~/Views/IndustryPage/_Survey.cshtml", model);

Html.RenderPartial("~/Views/Shared/PagePartials/_Questions.cshtml", Model.Questions);

Below is the custom view engine configured in my application for episerver blocks.

/// <summary>
/// Extends the Razor view engine to include the folders ~/Views/Shared/Blocks/ and ~/Views/Shared/PagePartials/
/// when looking for partial views.
/// </summary>
public class SiteViewEngine : RazorViewEngine
{
private static readonly string[] AdditionalPartialViewFormats = new[] { TemplateCoordinator.BlockFolder + "{0}.cshtml" };

/// <summary>
/// Initializes a new instance of the <see cref="SiteViewEngine"/> class.
/// </summary>
public SiteViewEngine()
{
PartialViewLocationFormats = PartialViewLocationFormats.Union(AdditionalPartialViewFormats).ToArray();
}
}

Can any one help to to fix this issue? This issue is effecting entire application performance. 

Thanks,

Suresh B


Viewing all articles
Browse latest Browse all 6894

Trending Articles