Skip to main content

How to configure a cache expiration date for a Web site or application in Asp.net(C#)

Here I will explain how to configure a cache expiration date for a Web site or application  in Asp.net(C#).

To Increse the performance of a website that is on IIs Server.
Enable client side browser caching for static content (like for example images, CSS, JavaScript, jQuery) that was not change in near future.


<configuration>
   <system.webServer>
  <staticContent>
           <clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMaxAge="12:00:00" cacheControlMode="UseExpires" />
        </staticContent>
   </system.webServer>
</configuration>

Comments