Dean Leigh
02/27/2024, 5:00 PMservices.Configure<SmidgeOptions>(options =>
{
options.DefaultBundleOptions.ProductionOptions.FileWatchOptions.Enabled = true;
options.DefaultBundleOptions.ProductionOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
options.DefaultBundleOptions.ProductionOptions.CacheControlOptions.CacheControlMaxAge = 12000;
});
But am no longer using Startup files.
I have tried in the notification handler and I'm down to a single syntax error, undoubtedly a terrible way to do it but I'm trying to learn the new way as I go.
FWIW other than this I have Smidge minifying and bundling as it should do ht @AaronSadlerUK
https://cdn.discordapp.com/attachments/1212081950794194994/1212081951251501166/image.png?ex=65f08a48&is=65de1548&hm=8051eefc44db1ed4afb92c0c39c87868a57c0f9b993fe9fefd52c94b114c2c01&Sebastiaan
02/27/2024, 7:57 PMcsharp
using Microsoft.Extensions.DependencyInjection;
using Smidge.Cache;
using Smidge.Options;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
namespace MyNameSpace;
public class BundleComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.Configure<SmidgeOptions>(options =>
{
options.DefaultBundleOptions.ProductionOptions.FileWatchOptions.Enabled = true;
options.DefaultBundleOptions.ProductionOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
options.DefaultBundleOptions.ProductionOptions.CacheControlOptions.CacheControlMaxAge = 12000;
});
}
}
Dean Leigh
02/27/2024, 7:59 PMDean Leigh
02/29/2024, 9:02 AMusing Umbraco.Cms.Core.Notifications;
using Umbraco.Docs.Samples.Web.Stylesheets_Javascript;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddDeliveryApi()
.AddComposers()
.AddAzureBlobMediaFileSystem()
.AddAzureBlobImageSharpCache()
.AddNotificationHandler<UmbracoApplicationStartingNotification, CreateBundlesNotificationHandler>()
.Build();
WebApplication app = builder.Build();
await app.BootUmbracoAsync();
app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
})
.WithEndpoints(u =>
{
u.UseInstallerEndpoints();
u.UseBackOfficeEndpoints();
u.UseWebsiteEndpoints();
});
await app.RunAsync();
Sebastiaan
02/29/2024, 10:36 AMProgram.cs
instead?Dean Leigh
02/29/2024, 11:25 AMSebastiaan
02/29/2024, 11:38 AMDean Leigh
02/29/2024, 12:02 PMCache-Control:
public, max-age=43200000, s-maxage=43200000
Dean Leigh
02/29/2024, 12:03 PMpublic, max-age=864000, s-maxage=864000
Dean Leigh
02/29/2024, 12:04 PMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by