andrewdavey/cassette — pull request #444 by cankoluman (2014-03-11 16:21:50+00:00)
Title: Addition of CDN management

It would be great to get this into the main distribution. I based the changes on the comments in the mailing list. Inherits from 'External Bundles' with local assets and generates CDN url prefixed urls for bundles, adds ability to pre-compress (gzip) a bundle, and rewrites URLs in css files assuming a mirrored deployment of assets to the CDN / S3 cloud. In debug mode, continues to use local assets.

Right now, the changes exist inside the main Cassette distribution - on account of 'internal' scoped items and to reduce code duplication. If internal scoped items are made public, then this could be moved into a separate project.

Usage example:

```csharp
public void Configure(BundleCollection bundles)
{
bundles.AddCdnUrlWithLocalAssets(
,
,
,
new LocalAssetSettings
{
// Local assets for use in debug mode.
Path = ,
FallbackCondition = "false"
},
bundle =>
{
((CdnStylesheetBundle)bundle).GzipStylesheetBundle(isDebuggingEnabled : bool, gzipInDebug : bool default false);
}
);

bundles.AddCdnUrlWithLocalAssets(
,
,
,
new LocalAssetSettings
{
Path = "",
FileSearch = new FileSearch
{
Pattern = "*.js"
},
FallbackCondition = "false"
},
bundle =>
{
((CdnScriptBundle)bundle).GzipStylesheetBundle(isDebuggingEnabled : bool, gzipInDebug : bool default false);
}
);
}
```

Cheers.