Note that there are some explanatory texts on larger screens.

plurals
  1. POAnd still, what is the magic of ASP.NET MVC Content folder?
    text
    copied!<p>I've just moved my resource files (javascript, css, images) from <code>Content</code> folder to custom <code>Assets</code> folder. And I've noticed a strange behavior - these files are not longer cached by browser and <a href="http://code.google.com/p/mvc-mini-profiler/" rel="nofollow noreferrer">MvcMiniProfiler</a> shows separate request for each resource located in <code>Assets</code> folder:</p> <p><img src="https://i.stack.imgur.com/lhDwD.png" alt="Before moving to Assets folder and after"></p> <p>I know that <code>Content</code> folder isn't required by ASP.NET MVC convention, but why this happens? Is <code>Content</code> treated somehow especially by anyone (e.g. ASP.NET, IISExpress, etc.)? And how to force caching for other folders that contain static resources?</p> <p><strong>EDIT:</strong> Oh, it appears to be not an ASP.NET MVC odd behavior, but just the standard behavior of MvcMiniProfiler. Currently I'm checking that...</p> <p><strong>EDIT:</strong> Yea, there is no problem with ASP.NET MVC, it's just a <a href="http://code.google.com/p/mvc-mini-profiler/source/browse/MvcMiniProfiler/MiniProfiler.Settings.cs#185" rel="nofollow noreferrer">default configuration</a> of MvcMiniProfiler to ignore only these paths: <code>"/mini-profiler-", "/content/", "/scripts/", "/favicon.ico"</code>. And these defaults can be easily extended:</p> <pre><code>MiniProfiler.Settings.IgnoredPaths = MiniProfiler.Settings.IgnoredPaths .Concat(new [] { "/assets/" }) .ToArray(); </code></pre> <p>Sometimes it's a good idea to read documentation before using something ;)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload