bjanaszek
bjanaszek

Reputation: 189

Some Static Content Loads Very Slowly

I'm attempting to install an MVC 2 web application to our production server. This app has been run and tested on several test servers, but in production, some static content (most notably JavaScript files) load very, very slowly (sometimes 60+ seconds). What's interesting, however, is that this isn't the case for all static content--during a typical page load cycle, all but one of the JS files will be successfully transferred to the client, but one will "stick" and sometimes never download.

What's also odd is that if I go directly to the static content, it loads immediately.

I've investigated the handler mappings, and compared the IIS configuration to our test environment, and everything is similar. What would cause this?

Upvotes: 3

Views: 2382

Answers (1)

Mohit Verma
Mohit Verma

Reputation: 1660

Try to set this in webconfig file for static contents , it will compress the file & result in fast rendering of page

 <system.webServer>

<httpProtocol allowKeepAlive="true"/>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
  <dynamicTypes>
    <add mimeType="text/*" enabled="true"/>
    <add mimeType="message/*" enabled="true"/>
    <add mimeType="application/javascript" enabled="true"/>
    <add mimeType="*/*" enabled="false"/>
  </dynamicTypes>
  <staticTypes>
    <add mimeType="text/*" enabled="true"/>
    <add mimeType="message/*" enabled="true"/>
    <add mimeType="application/javascript" enabled="true"/>
    <add mimeType="*/*" enabled="false"/>
  </staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>

<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />

Upvotes: 0

Related Questions