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
Closed

Implement abstract cache buster: ICacheBuster #51

Shazwazza opened this issue Nov 18, 2016 · 1 comment
Milestone

Comments

@Shazwazza
Copy link
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 added a commit that referenced this issue Nov 22, 2016
… files are peristed based on the cachebuster value
@Shazwazza Shazwazza added this to the 2.0 milestone Dec 19, 2016
@Shazwazza
Copy link
Owner Author

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
Projects
None yet
Development

No branches or pull requests

1 participant