how can use server side caching in mvc ?

Total Post:46


 328  View(s)
Rate this:

example is required 

  1. Re: how can use server side caching in mvc ?

    If we want to use cache for static contents, then we have to define a few configurations in our application's Web.Config file as below. Here you can see, we have defined the file extension with mime type which needs to be cache. To defining age of caching time, we use "cacheControlMaxAge" attribute from "clientCache" and define the time here. For this demonstration, we have used 1 minute.

          <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:01:00" />
          <mimeMap fileExtension=".jpg" mimeType="image/jpg"/>
          <mimeMap fileExtension=".png" mimeType="image/jpg"/>
          <mimeMap fileExtension=".css" mimeType="text/css"/>
          <mimeMap fileExtension=".js" mimeType="text/javascript"/>
        <validation validateIntegratedModeConfiguration="false" />
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />

    For more information, please follow the given below links :

      Modified On Jul-06-2019 03:56:37 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.