Implement abstract cache buster: ICacheBuster #51

Closed
Shazwazza opened this Issue Nov 18, 2016 · 1 comment

Projects

None yet

1 participant

@Shazwazza
Owner

The cache buster used should be pluggable - by default it will use the config based cache buster but this could be replaced by a developer with anything. We can specify a default for the debug or production environment options, but also specify a cache buster for an individual bundle.

@Shazwazza Shazwazza added a commit that referenced this issue Nov 22, 2016
@Shazwazza Implement abstract cache buster: ICacheBuster #51 - refactors so that…
… files are peristed based on the cachebuster value
4f9ea27
@Shazwazza Shazwazza added this to the 2.0 milestone Dec 19, 2016
@Shazwazza
Owner

This is done, the default can be set during startup and also custom ones can be set per bundle. Also a different cache buster can be set for the Debug/Production environments. Example:

Default

services.AddSmidge(_config)
    .Configure<SmidgeOptions>(options =>
    {
        options.DefaultBundleOptions.DebugOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
        options.DefaultBundleOptions.ProductionOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
    });

per bundle

bundles.Create("test-bundle-2", WebFileType.Js, "~/Js/Bundle2")
    .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
            .ForDebug(builder => builder
                .SetCacheBusterType<AppDomainLifetimeCacheBuster>()
            .Build()
    );
@Shazwazza Shazwazza closed this Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment