buunguyen / combres Goto Github PK
View Code? Open in Web Editor NEWASP.NET and MVC performance optimization library ⛺
License: Other
ASP.NET and MVC performance optimization library ⛺
License: Other
配置如下:
hi,
when making a change in css or script file combres restarts the application pool.
We use combres in our application which is mostly meant for intranet purposes. This means that the site in most cases requires authentication.
Some of the resources we use are dynamic. When combres tries to load these it causes a 401 authentication error.
As far as i can tell this is because combres will request the resource using a WebClient, however this web client does not use the credentials of the user logged onto the site, and therefore does not have access.
Would it be possible to set the WebClient.UseDefaultCredentials property to true? This should cause the WebClient to use the same credentials as the current request when using impersonation.
Perhaps make it an extra setting that can be setup per resource.
Combres 2.3.0.4 supports the latest version of Ajax Min. However, the library exposes many new properties that Combres doesn't support via configuration yet. It would be great if someone can help modify MSAjaxCssMinifier and MSAjaxJSMinifier to expose all the properties. It's not necessary to document those properties because they are already well documented in the AjaxMin repo.
A good solution would make it possible to be future-proof. For example, an idea would be using dynamic
(or just a dictionary) to store arbitrary properties in the minifiers, which in turn will bind to the actual library classes. That way, properties of future version of AjaxMin would still be supported without code change.
I tried to use combres to compress js file written with ES6 but it didn;t work, I wonder is it my configuration error, or it does not support ES6 at all?
I use combres in .NET 3.5 and I successfully intergrate combres in IIS.
But my main project use <clear /> in system.webServer
<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<clear />
<!--......-->
<remove name="UrlRoutingHandler" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule" />
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UrlRewrite" type="UrlRewritingNet.Web.UrlRewriteModule" />
<add name="UrlRoutingModule" preCondition="" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
</system.webServer>
When I use IIS to host my project, compress files aren't found.
May you help me?
Thanks a lot.
The exact message of the Exception as viewable in the event handler is Combres.CombresHandler.ProcessRequest failed with System.ArgumentException: Requested value 'CrunchAll' was not found.
I, unfortunately, have very little information other than that. It does not seem to have any discernible impact on the functionality of the website, but it is happening regardless.
The problem seems to be related to TypeExtensions.cs
In my MVC project I have dynamic call like this in my Razor view:
@(Html.CombresLink("publicCss" + Model.PublicSkinName))
The string passed in might resolve to "publicCssFubar", for example.
If however the resource name in my Combres.xml config is called "publicCssFuBar" - notice the capitial B - then the example of "publicCssFubar" will fail with the exception of "Resource set 'publicCssFubar' cannot be found" in Combres.WebExtensions.GetResourceSet(string setName) +65"
Could it be changed to be case insensitive?
I'm using the nuGet package which says I'm on v2.2.2.5 of combres.mvc. I checked the version history since that release and there doesn't appear to be any indication of this being changed.
Local of Google Closure Compiler support.
Use to the IKVM.
Compile compiler.jar for compiler.dll
JDK is no longer required.
Updated Use dotLess 1.4.1.0, AjaxMin 5.11.5295.12309 and Log4Net 2.0.3
Link:https://github.com/vallens/combres
Because a charset is being specified on the content-type header, IE9 is refusing to load the CSS.
Need to either remove the "UTF-8" charset from the header globally, or only if IE9 is detected.
I have LESS resource set that I want to reference from another CSS resource set inside an ASP.NET MVC 4 web application.
When I include the LESS resource set in my MVC view, the less files is compiled to CSS properly.
The issue is that LESS resourcesets don't get compiled in the outputted CSS when it's referenced from another resourceset.
The reason for the need for referencing a resourceset with less files is because a resourceset cannot have both css and less files per #5
Here is my relevant parsts of my configuration for combres.xml
<filters>
<filter type="Combres.Filters.FixUrlsInCssFilter, Combres" />
<filter type="Combres.Filters.DotLessCssCombineFilter, Combres" acceptedResourceSets="siteLess" />
</filters>
<!-- ... -->
<resourceSet name="siteLess" type="css">
<resource path="~/content/css/iconSetSprite.less" />
</resourceSet>
<!-- ... -->
<resourceSet name="homeCss" type="css">
<resource reference="siteLess" />
</resourceSet>
The less file itself has the following mixin:
.ds-icon-heart{ .ds-icon-empty-heart; }
After @Html.CombresLink("siteLess")
is called in the view, the LESS gets compiled to the following CSS:
.ds-icon-heart {
background-position: 0 -624px;
width: 17px;
height: 17px;
}
However, when that same LESS resource set is included in another CSS resource set the LESS the mixin does not get compiled.
After I called @Html.CombresLink("homeCss")
, mixin .ds-icon-heart{ .ds-icon-empty-heart; } does not get compiled.
dotless has a lot of configurable property but as far as i see, u implemented dotless support in filters (Commented code was yours):
//private static readonly DotlessConfiguration Config = new DotlessConfiguration
//{
// CacheEnabled = false,
// MinifyOutput = false
//};
private static readonly bool IsStrictMathEnabled = (ConfigurationManager.GetSection("dotless") as DotlessConfiguration).StrictMath;
private static readonly DotlessConfiguration Config = new DotlessConfiguration
{
CacheEnabled = false,
MinifyOutput = false,
StrictMath = IsStrictMathEnabled
};
You should have implemented a way to configure it. Strict math is a key feature, css syntax is improving and there is no way to use "calc" support without it. So, i had to enable it by modifying your code.
Thanks for improvements.
Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089',
I'm using .NET 4.0.,mvc2
How should I solve the problem? Thanks
I just integrated the Combres v2 into a project I’m working on and have a quick question….
I’d like to know if there’s a way to control what attributes/values Combres output for a , such as the "media" attribute like so:
In 2.2.2.17 the fasterflect dependency went from "2.1.2.0" to "[2.1.0]", and it complains that a newer version is installed when I try to update combres. Is there a reason to force the older version? The latest version on nuget doesn't seem to be pushed to github yet, so I can't investigate the reasoning for myself.
Thanks,
Jeff
While compiling CSS resources, also inline the @import
resources and then compile/build
How could we configure combres to transpile JS via babel before minifying?
Hi.
We are having kind of a problem since our web site run on a server farm.
The response header last-modified is different from one server to the other.
Because of that we are unable to take advantage from having a 304 response.
When the user hits a different server it gets a different date and because of that he download the file again.
I noticed in you code that in the method:
Combres.RequestProcessor:SendOutputToClient(byte[], bool, string)
you have the line
cache.SetLastModified(DateTime.Now);
To solve this problem i see two ways or event both.
Thanks
I've been using Combres for a few years and there is a gotcha when using a CDN that has always bugged me/caused headaches. In a scenario when your origin is pointing back to your production servers it is pretty easy get incorrect file version cached on the edge servers.
For instance if you have server pool A that has the following css, referenced as cdn.domain.com/combres/css/v1/
{body {color:#red}}
Now we want to change the text to blue so we update the file and deploy to server pool B
cdn.domain.com/combres/css/v2/
{body {color:#blue}}
Now our QA team wants to verify the new text color on the servers before the load balancer is flipped. A tester pulls up one of the servers in his browser and sees all the body copy still in red, WTF! Not only do I have to deal with a new bug report but even worse we've just cached the old version of the file with the new file path. The CDN saw the request for /css/v2/, didn't have a copy of it, so proceeded to domain.com/combres/css/v2/ to download, which is the current red text version, damn.
This can be mitigated by not hitting any server before it is in production in this case, but it still happens sometimes. Also we have had problems in the past with both Azure and Appharbor not doing a 100% clean flip when new code is deployed, so traffic can still be served by out-of-date servers for some small period of time, and the likelihood of this happening tends to increase as the number of servers you have goes up. Flushing the CDN for all the files after each deployment is an option, but takes time, time that visitors can be seeing funky styles or perhaps completely broken javascript. Also during that window, the incorrect files will be cached on many browsers, a place where we have no control over forcing a flush, so they will have bad files for the foreseeable future or until we do a version bump and deploy, which starts the process over again.
Sorry for the long-winded example, fortunately there is an easy fix! Just don't send the cache headers if the version in the url does not match the current resource set version. See here:
leafly-com/combres@62dfe7ac69
Let me know if you would like a pull request. Thanks for the continued work on this project.
It seems that if you add a .less file with .css files in the same resource set, you get the following error:
Value cannot be null.
Parameter name: css
It works fine if I add a separate resource set for my .less file, so maybe this is by design. If so, you may want to call that out in the docs.
Great work on this project!
I am looking to combine require.js functionality with combres.
The idea is that while building the script it will follow the require
statements..
I am using the standard Combres.Minifiers.YuiCssMinifier for compression with the default values for CssCompressionType as StockYuiCompressor and ColumnWidth set to -1
I have upgraded from the 2.0 version to the current NuGet package.
After updating, only on our production servers, CSS files fail to be uncompressed.
In the headers, the only change was "; charset=utf-8" was added to the Content-Type header. With the older version this was not there.
I used Fiddler2 to save the raw response body outputs to files with the old version working, and the new combres version.
The bodies are COMPLETELY different. It looks like the new version is reading the file as one encoding, then minifying and compressing and streaming as gzip as a different encoding.
I used a hexeditor to view the byte differences.
In the working (old) response, the first 3 bytes are filled in, then 5 empty bytes. In the new (failing) response the first 5 bytes are filled in, then 5 empty bytes.
When attempting to decompress in Fiddler2, the error message is that the magic number is malformed.
I used GnuZip to attempt a test, but no errors come back except for it is in an invalid format.
If I disable compression, the error goes away and the file is minified and works correctly.
We are upgrading because the old version's minification is broken for mobile phones. It removes too many spaces in CSS definitions and phones fail to load that line of CSS.
After hours of head-banging, I realized that resource paths cannot contain wildcards and the "*" in my paths (works with every other minifier/concatonator I've used) was causing the exception. Catching this exception and mentioning the literal path causing the issue in the exception data would make this infinitely easier to address.
Also, what about wildcards? No support using the typical characters; what about including all resources (css or js based on the resourceSet type) in a folder; possible? Would only have to detect that the path is a folder then parse all the files matching the appropriate extension and include them.
Looks like it wouldn't take too much work in API/WebExtensions.cs to accomplish both of these things. I will see if I can do it and submit a pull request unless you reply and say otherwise.
See below for stack trace and example combres.xml that will throw the exception
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=Illegal characters in path.
Source=mscorlib
StackTrace:
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath)
at Combres.ResourceContentReader.ReadNewContent(Resource resource)
at Combres.VersionGenerators.HashCodeVersionGenerator.<>c__DisplayClass6.<Generate>b__1(Resource r)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at Combres.VersionGenerators.HashCodeVersionGenerator.Generate(ResourceSet rs)
at Combres.ResourceSet.InitializeVersion(XElement xe, Settings parent)
at Combres.Settings.LoadResourceSets(XContainer xe)
at Combres.ConfigReader.CreateSettings(XDocument xdoc)
at Combres.Configuration.ReloadSettings()
at Combres.Configuration.InitializeConfig()
at Combres.Configuration.GetSettings()
at Combres.WebExtensions.CombresLink(String setName, Object htmlAttributes)
at ASP.ola_master.__Rendercst(HtmlTextWriter __w, Control parameterContainer) in C:\HIGH_SPEED_CONTENT\PROJECTS\AZPREP\GIT\WEB\OLA\OLAWeb\OLA.Master:line 15
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlHead.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
App_Data\combres.xml
<?xml version="1.0" encoding="utf-8" ?>
<combres xmlns='urn:combres'>
<filters>
<filter type="Combres.Filters.FixUrlsInCssFilter, Combres" />
</filters>
<resourceSets url="~/combres.axd"
defaultDuration="30"
defaultVersion="auto"
defaultDebugEnabled="false"
defaultIgnorePipelineWhenDebug="true"
defaultCompressionEnabled ="false"
localChangeMonitorInterval="30"
remoteChangeMonitorInterval="60" >
<resourceSet name="siteCss" type="css">
<resource path="~/css/custom-theme/*.css" />
</resourceSet>
</resourceSets>
</combres>
Hi, is there any change for packages update like one year ago? New combres nuget with latest libraries would help in maintaining older projects.
combres.log4net.nuspec
from
<dependency id="WebActivatorEx" version="[2.0.6]" />
<dependency id="dotless" version="[1.4.1.0]" />
to
<dependency id="WebActivatorEx" version="2.1.0" />
<dependency id="dotless" version="1.5.2.0" />
combres.log4net.nuspec
from
<dependency id="log4net" version="[2.0.3]" />
to
<dependency id="log4net" version="2.0.5" />
For now, any update is not possible because of version range: [X.X.X]. Any newer WebActivatorEx package is not valid. X.X.X version range (without the square brackets) would be the best.
https://docs.nuget.org/create/versioning
Hi,
The RequestProcessor.SendOutputToClient sets both MaxAge and Expires headers. This is valid and MaxAge should be used in favor of Expires by clients. But this seems to be a bit buggy in some implementations. Amazon CloudFront in particular, has problems with this (http://www.cdnplanet.com/blog/cloudfront-cachability-date-header/).
I suggest removing the Expires heading, or make it configurable as in IIS . There are very few clients today anyway that don’t support MaxAge and do we really care about caching for those clients? Let’s release those extra bytes in the header for all other users instead. (Of course I'd prefer if Amazon could fix the error in their end, but this has been a known bug for years.)
/ Mikael
I tried to use this on a site hosted on godaddy and I end up with following:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
The error itself is below.
Besides running the nuget update, Is there any thing to change?
It seems that something Combres is looking for using FasterFlect is not there anymore...
Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.
Source Error:
Line 6: public static class Combres {
Line 7: public static void PreStart() {
Line 8: RouteTable.Routes.AddCombresRoute("Combres");
Line 9: }
Line 10: }
[MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.]
Fasterflect.Emitter.CtorInvocationEmitter.CreateDelegate() +0
Fasterflect.Emitter.BaseEmitter.GetDelegate() +251
Combres.NoArgCtorCreator.Create(Type loggerType, String name) +98
Combres.Configuration..cctor() +58
[TypeInitializationException: The type initializer for 'Combres.Configuration' threw an exception.]
Combres.Configuration.GetCombresUrl() +24
Combres.WebExtensions.AddCombresRoute(RouteCollection routes, String name) +400
Babieca.App_Start.Combres.PreStart() in C:\Users\IngMatiasGamarra\Desktop\BABIECA\Babieca\App_Start\Combres.cs:8
We've been using Combres for a long time and recently upgraded to v2.3.0.4 after one of our test servers experienced an issue where it failed to load JS/CSS resources. Although as it turns out that didn't solve the issue, however we stuck with the latest version of Combres.
Unfortunately we are now experiencing a related issue. We have a JS resource set that includes another resource set plus a couple of other JS files. When running on local dev machines using real IIS on their machines it all works nicely in debug. However after building for release mode and thus using minified/concatenated settings in the combres.release.xml (vs combres.xml for debug) when we deploy this to a real IIS sever (Win Server 2012R2) that is used by our internal test team if fails to load a JS resource set, which as you might expect leads to various things not working.
The event log on my machine when using the release built version and the error is generated is:
Exception type: EcmaScriptRuntimeException
Exception message: syntax error
at Yahoo.Yui.Compressor.CustomErrorReporter.Error(String message, String sourceName, Int32 line, String lineSource, Int32 lineOffset)
at EcmaScript.NET.Parser.AddError(String messageId)
at EcmaScript.NET.Parser.ReportError(String messageId)
at EcmaScript.NET.Parser.primaryExpr()
at EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax)
at EcmaScript.NET.Parser.unaryExpr()
at EcmaScript.NET.Parser.mulExpr()
at EcmaScript.NET.Parser.addExpr()
at EcmaScript.NET.Parser.shiftExpr()
at EcmaScript.NET.Parser.relExpr(Boolean inForInit)
at EcmaScript.NET.Parser.eqExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit)
at EcmaScript.NET.Parser.andExpr(Boolean inForInit)
at EcmaScript.NET.Parser.orExpr(Boolean inForInit)
at EcmaScript.NET.Parser.condExpr(Boolean inForInit)
at EcmaScript.NET.Parser.assignExpr(Boolean inForInit)
at EcmaScript.NET.Parser.expr(Boolean inForInit)
at EcmaScript.NET.Parser.primaryExpr()
at EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax)
at EcmaScript.NET.Parser.unaryExpr()
at EcmaScript.NET.Parser.mulExpr()
at EcmaScript.NET.Parser.addExpr()
at EcmaScript.NET.Parser.shiftExpr()
at EcmaScript.NET.Parser.relExpr(Boolean inForInit)
at EcmaScript.NET.Parser.eqExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit)
at EcmaScript.NET.Parser.andExpr(Boolean inForInit)
at EcmaScript.NET.Parser.orExpr(Boolean inForInit)
at EcmaScript.NET.Parser.condExpr(Boolean inForInit)
at EcmaScript.NET.Parser.assignExpr(Boolean inForInit)
at EcmaScript.NET.Parser.expr(Boolean inForInit)
at EcmaScript.NET.Parser.primaryExpr()
at EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax)
at EcmaScript.NET.Parser.unaryExpr()
at EcmaScript.NET.Parser.mulExpr()
at EcmaScript.NET.Parser.addExpr()
at EcmaScript.NET.Parser.shiftExpr()
at EcmaScript.NET.Parser.relExpr(Boolean inForInit)
at EcmaScript.NET.Parser.eqExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit)
at EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit)
at EcmaScript.NET.Parser.andExpr(Boolean inForInit)
at EcmaScript.NET.Parser.orExpr(Boolean inForInit)
at EcmaScript.NET.Parser.condExpr(Boolean inForInit)
at EcmaScript.NET.Parser.assignExpr(Boolean inForInit)
at EcmaScript.NET.Parser.expr(Boolean inForInit)
at EcmaScript.NET.Parser.statementHelper(Node statementLabel)
at EcmaScript.NET.Parser.statement()
at EcmaScript.NET.Parser.Parse()
at Yahoo.Yui.Compressor.JavaScriptCompressor.Parse(StreamReader stream, ErrorReporter reporter)
at Yahoo.Yui.Compressor.JavaScriptCompressor.DoCompress(String source)
at Combres.Minifiers.YuiJSMinifier.Minify(Settings settings, ResourceSet resourceSet, String combinedContent)
at Combres.RequestProcessor.MinifyContent(MinifierInfo minifierInfo, IEnumerable`1 resources, String combinedContent)
at Combres.DefaultProcessingWorkflow.ProcessMergeGroup(ICollection`1 minifiedContents, IEnumerable`1 mergeGroup, MinifierInfo currentMinifier)
at Combres.DefaultProcessingWorkflow.Execute()
at Combres.RequestProcessor.Execute()
at Combres.CombresHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Is there any way right now to reset the url hashes for resources? We're deployed to Azure, which uses a pass through cache with no ability to reset the cache. When we flip from staging to production, we're having issues where Combres will respond on the old server to requests and then they're cached in Azure CDN with nothing we can do to clear it. The only way we can get it to work is to reset the server so it generates new hashes.
It is impossible to install combres's NuGet package, as it uses strict dependency versions.
Sourcecode is .15, NuGet is .17 ?
I noticed the source code uploaded here is missing /Library folder, so I am not able to rebuild it after cloning from git.
While i ma not sure on the exact implementation, But in many cases while loading resources. there is a need to have multiple resources loaded efficiently.
What i am looking for is:
path/to/combresResource?resources=resourceID1,resourceID2,resourceID3
which would generate (minify uglify etc.) all required resources?
Additionally, if one of the resources has a require
statement, that should be combined too as part of the final requested resource..
Does this make sense?
Hello,
I tried to add a new css minifier reference just i have always been using for jsminifiers, but it does not work. I oftenly use NullMinifier in order not to minify some of my files because they contain hacks which results in empty results.
I am defining my null js minifier as:
I am trying the same for css, but not working. I am using version 2.2.2.18 by the way. If this is not a bug (a non-existing feature), it will be very good to have IMO.
Thanks.
There have been improvements made to YUICompressor.NET and it boasts to almost match the Java version with the latest release.
Taking a look at Combres code there would be some implications. I'd have a go at making those changes but would like to get some feel on at least the first of the considerations below
In combres_full_with_annotation the options for the YUI minifiers are incorrect. This causes an exception if you try to use any of the YUI minifiers with the incorrect settings
<minifier name="yui" type="Combres.Minifiers.YuiCssMinifier, Combres">
<param name="CssCompressionType" type="string" value="StockYuiCompressor" />
<param name="RemoveComments" type="bool" value="true" />
<param name="ColumnWidth" type="int" value="-1" />
</minifier>
---> CssCompressionType is not supported in YuiCssMinifier so needs to be removed
ColumnWidth is also not supported.
LineBreakPosition is supported by not listed
<minifier name="yui" type="Combres.Minifiers.YuiJSMinifier, Combres">
<param name="IsVerboseLogging" type="bool" value="false" />
<param name="IsObfuscateJavascript" type="bool" value="true" />
<param name="PreserveAllSemicolons" type="bool" value="false" />
<param name="DisableOptimizations" type="bool" value="false" />
<param name="LineBreakPosition" type="int" value="-1" />
</minifier>
---> IsObfuscateJavascript must be ObfuscateJavascript.
There is also a IgnoreEval property in YuiJSMinifier that is not described in the annotated xml
Hi Buu,
I tried to use combres to compress AngularJs but it didn't work. Do you have any way to move all AngularJs files into one file. My project is working with ASP.NET 2, MVC.NET 2 and Combres 2.2
It's great if you have any solution!
Thanks in advanced!
Hi,
In cluster setups with many content delivery servers, it’s usually impossible to deploy new versions of js/css files in an atomic operation. This means that a newly updated server will start serving links to resource sets with an updated version number, but the request for that resource may end up on another cluster node that hasn’t been updated yet. This means the client will get the old content with the new URL – and it’s being cached. Add a CDN to this, and the problem cannot be neglected. The fault will hit everyone.
One way of solving this could be to compare the incoming version number in RequestProcessor with the version number of the current resource set. If they differ, shorten the cache timeout to something like ten minutes (configurable), so that the content isn’t cached very long and will soon be refetched.
/ Mikael
We are using combres and i want to know if we can change the URL format from
/combres.axd/scripts.head/-1858562714/
to
/combres.axd/scripts.head?r=-1858562714
This would help us a lot since for Akamai the url ending with "/" is a directory and may take from 20 to 40 minutes to purge or invalidate and the url using "?" take from 1 to 7 minutes to purge or invalidate.
After last update i found some issue with ilmerge tool.
[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
Detail about this issue.
http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx
No matter what you set defaultCompressionEnabled to, it always uses gzip compression.
It would be nice if there was an optional parameter to the CombresLink method-- or a configuration file option-- so that when it spits out the SCRIPT tag (or LINK tag) it would actually spit out each file in the set. This will allow for easier debugging when working local-- basically not having Combres do any processing on the files, just spit out the individual tags.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.