Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement abstract cache buster: ICacheBuster #51

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

Comments

Projects
None yet
1 participant
@Shazwazza
Copy link
Owner

commented Nov 18, 2016

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 added a commit that referenced this issue Nov 18, 2016

Shazwazza added a commit that referenced this issue Nov 22, 2016

Implement abstract cache buster: ICacheBuster #51 - refactors so that…
… files are peristed based on the cachebuster value

@Shazwazza Shazwazza added this to the 2.0 milestone Dec 19, 2016

@Shazwazza

This comment has been minimized.

Copy link
Owner Author

commented Dec 19, 2016

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()
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.