A blast from the past

Back in ASP.NET 4, we could easily disable static files caching by adding some lines to our main application's Web.config file, such as the following:

 <caching enabled="false" /> <staticContent>   <clientCache cacheControlMode="DisableCache" /> </staticContent> <httpProtocol>   <customHeaders>     <add name="Cache-Control" value="no-cache, no-store" />     <add name="Pragma" value="no-cache" />     <add name="Expires" value="-1" />   </customHeaders> </httpProtocol>  

That would be it; we can even restrict such behavior to the debug environment by adding these lines to the Web.debug.config file.

We can't use the same approach in .NET Core, as the configuration system has been redesigned from scratch and is now quite different from ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.