Skip to content

Instantly share code, notes, and snippets.

@styfle
Created July 13, 2017 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save styfle/e5e54cb3156088b37729a626e1301b74 to your computer and use it in GitHub Desktop.
Save styfle/e5e54cb3156088b37729a626e1301b74 to your computer and use it in GitHub Desktop.
Security and Caching settings for web.config in ASP.NET
<system.web>
<httpCookies requireSSL="true" />
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000"/>
<add name="X-XSS-Protection" value="1; mode=block"/>
<add name="X-Content-Type-Options" value="nosniff"/>
</customHeaders>
</httpProtocol>
<staticContent>
<remove fileExtension=".js.map" />
<mimeMap fileExtension=".js.map" mimeType="application/json" />
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1000.00:00:00" />
</staticContent>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment