Coder Social home page Coder Social logo

combres's People

Contributors

antonmordvinov avatar bitdeli-chef avatar buunguyen avatar nathanhillyer avatar sarvasana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

combres's Issues

Resources with mode Dynamic requiring authentication causes problems.

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.

Support all properties of Ajax Min

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.

Combres does not support ECMAScript2015

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?

How to config in IIS when I use clear tag in system.webServer-handlers

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.

CombresHandler.ProcessRequest throwing ArgumentException with no discernible pattern.

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

combres

Calls to CombresLink are case sensitive - could this be changed?

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.

Support mixing Less and CSS in the same resource set

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 strictMath mode not configurable

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.

The latest version does not supportMVC2?

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

Syncronization of last modified date on the response header.

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.

  1. The user can set on the date he wants on the combres.xml on the resourceSet element.
  2. You can get the latest modified date from all the files composing the resourceSet.
    1+2.Use the option 2 as default but the user can override this behavior by setting the value of option 1.

Thanks

Caching, versioning, and CDNs

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.

Using .less and .css resources in the same resource set produces an error.

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!

Default Combres CSS Compressor fails to GZip correctly

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.

WebExtensions.CombresLink("resourceSetName") throws System.ArgumentException and WildCard Support

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>

Nuget update

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

Refine cache control configuration

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

System.Security.SecurityException: That assembly does not allow partially trusted callers.

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.

After updated to last version error in RouteTable.Routes.AddCombresRoute("Combres");

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

Failing to load resource set in v2.3.0.4 with .NET 4.5.2+ and MVC5

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)

Ability to reset urls

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.

Allow serving resources via a resource URL

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?

Custom css minifiers

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.

Update to use later/latest version of YUICompressor.NET

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

  1. Remove strong naming as YUICompressor.NET did so after version 1.7. This would also make future upgrades much easier (without having to compile YUI each time). There seems to be a twitter consensus that strong naming is losing favour, note a question from YUICompressor author: http://stackoverflow.com/questions/19215186/should-i-strongname-strong-sign-an-oss-dll
  2. The Compressor calls have been changed from being constructor passed to property setting. Not major but the Css compressor no longer has a ColumnWidth property and now has a LineBreakPosition property. Is this note worthy? Should something be done with it?
  3. Some configuration changes might have to be made for this as well, have not taken the debugging any further until I hear back.

Configs for YuiCssMinifier and YuiJSMinifier incorrect and cause exceptions

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

Combres can not minify AngularJs

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!

Version checking to control cache

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

Change in the URL format

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.

Enhancement: Ability to spit out separate file includes..

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.