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

Issues with AppDomainLifetimeCacheBuster #195

Closed
shropgov-neil opened this issue Jun 23, 2023 · 3 comments
Closed

Issues with AppDomainLifetimeCacheBuster #195

shropgov-neil opened this issue Jun 23, 2023 · 3 comments
Labels

Comments

@shropgov-neil
Copy link

I'm using Umbraco 11 with the "AppDomain" setting, which, from tracing the code through Umbraco, seems to just hand off cachebusting to AppDomainLifetimeCacheBuster.

However, no matter what, the cachebuster value is permenantly "v1", and does not change on app restart - this makes the cachebuster useless as, while the internal caches are rebuilt, the browser continues to load it's locally cached version.

Is this an issue your end, or are Umbraco doing something behind the scenes to cause this issue?

@Shazwazza
Copy link
Owner

The AppDomainLifetimeCacheBuster implementation is very simple: https://github.com/Shazwazza/Smidge/blob/develop/src/Smidge.Core/Cache/AppDomainLifetimeCacheBuster.cs

It generates a one time value of the current datetime ticks

If "v1" is being used, then the cache buster is not actually being set to this cache buster type. Are you referring to assets in the back office of Umbraco or when you are using Smidge on the front-end? And where/how are you setting this cache buster value?

@shropgov-neil
Copy link
Author

I thought as much - I'm guessing this is an issue with Umbraco's implementation then.
I'm not setting a version value at all, I just set "CacheBuster": "AppDomain" in appsettings.json, as per their documentation.

This should, in theory, use your AppDomainLifetime class, as per here;
https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs#L79

This is on the front end, using SmidgeHelper.Create[Css/JS]Bundle, and the Smidge tag helpers.

@shropgov-neil
Copy link
Author

Turns out Umbraco doesn't set the DefaultBundleOptions, it only sets WithEnvironmentOptions() on the explicit bundles created for the back office. I ended up manually configuring the SmidgeOptions with same config for use on the front end.
umbraco/Umbraco-CMS#15165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants