1

I have an ASP.NET MVC site and very simple pages, but after publishing the app the pages are very slow for the first time. For subsequent refreshes they all work fine.

It is important to note it's just the first page that takes time. BUT, each page takes time for the first request.

This is my Publish Profile XML content:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>D:\demo-projects\published\Coupon</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
  </PropertyGroup>
  <Target Name="CustomAction" AfterTargets="CopyAllFilesToSingleFolderForPackage">
    <Message Text="Minifying files....." />
    <Exec Command="D:\Projects\html-minifier-master\Tool\htmlminifier.exe $(_PackageTempDir)" IgnoreExitCode="true" />
  </Target>
</Project>

Is there anything that could be improved here?

2 Answers 2

7

This is normal behaviour for any website that is published. When you publish, files are updated, and these need to be loaded into the IIS session and will remain loaded until a subsequent update, or an Application pool refresh.

There is nothing major to be concerned about and nothing you can resolve in your publish profile.

2
  • However, each page takes 5 second roughly to respond. Is that normal or looks something suspicious on hosting server? I'm using mochahost.
    – Mrug
    Oct 4, 2018 at 10:40
  • 1
    As long as only the first time, nothing to worry about and nothing to be deemed as suspicious. If you are seeing longer loading times then it might be a good idea to review what your page is actually doing.
    – Kinexus
    Oct 4, 2018 at 10:42
1

This is not an issue bro... these are the possible causes of slow loading:

  1. For the first request, all physical files are getting downloaded for the first time.
  2. Caching is under process for further request enhancement.
  3. Images are being loaded to refresh the page frequently next time.

You can do these changes to improve enhancement:

  1. Reduce the size of images.
  2. Bundle the JavaScript and CSS content.
1
  • What do you mean by "Caching is under process for further request enhancement"? Can you elaborate (preferably by editing your answer)? Oct 6, 2018 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.