Tuesday, 15 June 2010

asp.net mvc - Why Scripts.Render invoke JsMinify.Process? -



asp.net mvc - Why Scripts.Render invoke JsMinify.Process? -

i profiled asp.net mvc application , saw unusual function calls.

you can see on image

always when mvc render layout invoke system.web.optimization.scripts.render invoke jsminify.process , minifier.minifyjavascript, thought minification should 1 time on start app.

am right?

maybe must set settings optimization it?

conditions:

localhost release bundletable.enableoptimizations = true;

great question!

intuitively, right, minification of assets should performed on application startup. assume assets delivered identically browsers. microsoft believes much of js , css browser specific.

if check asp.net site's reference on asp.net 4.5 bundling , minification, state:

bundling , minification in asp.net 4.5 performed @ runtime, process can identify user agent (for illustration ie, mozilla, etc) , , thus, improve compression targeting user browser (for instance, removing stuff mozilla specific when request comes ie).

:

what caching?

bundling isn't obtuse profiled have think. if mvc 4 bundling , minification reference, point out:

bundle caching

bundles set http expires header 1 year when bundle created. if navigate viewed page, fiddler shows ie not create conditional request bundle, is, there no http requests ie bundles , no http 304 responses server.

this far more info need, message that, jsminify has check relevant cached minified assets.

when factor in farther utilize minified version of our assets (eg jquery.min.js, jquery-ui.min.js), can appreciate .net minification supplemental process.

why minification of types have happen

asp.net-mvc optimization asp.net-mvc-5 bundle webgrease

No comments:

Post a Comment