web-optimization

What is the proper use of IItemTransform for correcting paths in CSS Bundling with ASP.NET Web Optimization and BundleTransformer?

梦想与她 提交于 2019-12-04 07:19:52
I'm presently working on a project that uses the ASP.NET Web Optimization library (v 1.1.0-Beta1) in conjunction with the Bundle Transformer extension (v 1.7.3-Beta1 for core, 1.7.0-Beta1 for LESS) which is used to convert LESS into CSS. Based on web searches paths within CSS (and less) appear to be a common issue, in most cases it is recommended to manually modify the CSS and be done with it. However, due to differences between our development and production environment, and not owning the affected CSS such a solution is not feasible. Two solutions seem to exist. The first is to overlay the

What is the best way to optimize a Windows Server 2008 box running IIS7 to serve only static files?

两盒软妹~` 提交于 2019-12-03 17:17:18
I would like to have our web applications pull static content (css, js, images) from a static file server running Windows Server 2008 and IIS7. What sort of optimizations would you make to the server for this single purpose? (Machine.config changes? Web.config changes? Special IIS7 setup or modules? What?) Some advices: Enable gzip compression: http://blogs.msdn.com/vivekkum/archive/2009/02/18/http-compression-in-iis-6-and-iis-7-using-service-account.aspx Set Cache-Control: max-age to 31536000 (1 year). code.google.com will tell you why --> http://code.google.com/speed/page-speed/docs/caching

MVC Bundling - Include .min file for a single bundle

a 夏天 提交于 2019-11-30 16:00:00
I have a single file in my application that I only have a minified version of and I would like to create a bundle for it: bundles.Add(new ScriptBundle("~/bundles/maskedinput").Include( "~/Scripts/jquery.maskedinput-1.3.min.js")); The problem is that by default in debug mode, the bundling mechanism ignores .min files. I don't want to turn off this rule for all bundles, but I would like to disable it for this single bundle. Is this possible? Colin Bacon A quick fix is to rename the js file taking out .min. Or as per the solution in this link you can create your own ignore patterns. https:/

How to use 3-digit color codes rather than 6-digit color codes in CSS?

和自甴很熟 提交于 2019-11-27 11:45:37
I recently went through my CSS file and switch all my 6-digit hexadecimal codes to simple 3-digit codes (for example, my #FDFEFF got shortened to #FFF ). It renders pretty much the exact same color as before, it seems to me that the in between parts are fairly useless and removing them saved me an entire 300 bytes in my CSS file. Does it matter which version you use? I rarely ever run across websites that use only the 3-digit codes (or I guess I just never run across ones that do). Is it still perfectly valid to use 3-digit codes over 6-digit codes, or are we supposed to use the full 6-digit

CssRewriteUrlTransform is not being called

强颜欢笑 提交于 2019-11-27 02:04:46
问题 I just created a new MVC 5 app on VS 2013 RTM. For some reason background image url in my CSS files were not being transformed. So, to debug the issue, I created my custom CssRewriteUrlTransform wrapper. And I found that my breakpoint is not being called. This is what I have in my BundleConfig.cs using System.Web.Optimization; namespace Utilities.Web { public class BundleConfig { private const string JQUERY_CDN_URL = "//code.jquery.com/jquery-1.10.1.min.js"; public static void RegisterBundles

CssRewriteUrlTransform with or without virtual directory

若如初见. 提交于 2019-11-27 00:16:47
We are using MVC Bundling in our site, CssRewriteUrlTransform makes sure that the image urls work from the dynamic bundle css file. But this only works when not using a virtual directory, i.e http://localhost/VirttualDir does not work but http://localhost/ does. This is because the CssRewriteUrlTransform tranform does not take the virtual folder into account when rewriting the url. So if a image real path is localhost/vdir/content/img/foo.png it will rewrite it to localhost/content/img/foo.png which is wrong BernardG I am not sure to fully understand your problem, but seeing http://localhost

How to use 3-digit color codes rather than 6-digit color codes in CSS?

半腔热情 提交于 2019-11-26 15:43:05
问题 I recently went through my CSS file and switch all my 6-digit hexadecimal codes to simple 3-digit codes (for example, my #FDFEFF got shortened to #FFF ). It renders pretty much the exact same color as before, it seems to me that the in between parts are fairly useless and removing them saved me an entire 300 bytes in my CSS file. Does it matter which version you use? I rarely ever run across websites that use only the 3-digit codes (or I guess I just never run across ones that do). Is it