External Scripts

You may want to reference an external script URL in multiple pages. Repeating the URL in each page is not ideal. If you ever need to change it you'll have to search through all the pages.

Cassette supports the definition of external script URLs at the application level. You can then reference them by a short, fixed, name. In addition you can specify a fallback URL if, for example, a CDN fails.

public class CassetteConfiguration : ICassetteConfiguration
    public void Configure(BundleCollection bundles, CassetteSettings settings)

            new LocalAssetSettings
                // Local assets for use in debug mode.
                Path = "scripts/jquery.js",
                // When condition is true, uses the local assets
                FallbackCondition = "!window.jQuery"

Now in view pages, these external scripts can be referenced by path.

<!DOCTYPE html>