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

Update Smidge Config to reflect the UmbracoSmidgeConfigCacheBuster #3891

Merged
merged 8 commits into from Jul 7, 2022
28 changes: 16 additions & 12 deletions Reference/Configuration/RuntimeMinificationSettings/index.md
Expand Up @@ -19,39 +19,43 @@ This section allows you to configure the runtime minifications (defaults shown),
}
}
```
## Use 'in memory' cache

## Use in memory cache

Specifies if Smidge should use an in memory cache or not.
This setting determines whether Smidge should save it's cached output in memory, or in a file on disk. If set to false, then the folder will be created at the wwwroot of your Umbraco site in a folder called 'Smidge'/

## Cache buster

Specifies what type of cache buster to use, the options are:
Specifies mechanism for cache invalidation.

The options are:

* Version - Caches will be busted every time the version string changes.
* Version - Caches will be busted when your assembly version changes, when the upstream Umbraco version changes and when the version string specified in Configuration changes.
* AppDomain - Caches will be busted when the app restarts.
* Timestamp - Caches will be busted based on a timestamp.
* Timestamp - Caches will be busted based on a timestamp of the bundled files.

## Automatically generated settings
## Manually changing the Cache buster version

If you use a CacheBuster setting of "Version" you can add an additional configuration option, also called 'Version'
If you use a CacheBuster setting of "Version" you can add an additional configuration option, also called 'Version' , which allows you to set a value that you can incremement manually, or via a build server to make sure the version number changes for Smidge and busts the cache.

```json
"Umbraco": {
"CMS": {
"RuntimeMinification": {
"UseInMemoryCache": false,
"UseInMemoryCache": true,
"CacheBuster": "Version",
"Version": "1234"
}
}
}
```
The actual 'Version' number will not be visible in the url of the assets, this is because it is combined, along with the Umbraco Version from configuration and the your project assembly dll, and then once combined a 'hash' is generated to obscure these details.

in the HTML link thus: ```<link href='/sb/umbraco-backoffice-init-css.css.v7a71f91360259c5f7c3337f152b0df01eeee36f0' rel='stylesheet' type='text/css'/>``` (when [`Umbraco:CMS:Hosting:Debug:false`](../HostingSettings/index.md))

to control the version number generated in the HTML link thus: ```<link href='/sc/69a3dbf6.1cf661e7.css.v1234' rel='stylesheet' type='text/css'/>```
So if you increased the Version in the configuration by 1 to 1235, all you would see is a different hash!

:::note
Generally you don't need to add this. However, if you're making some front end changes and not seeing the change, then you can add this option and increase the number by one each time, clearing the cache and rendering the change.
For production environments, it's recommended to set Cache Buster to 'Version' (you don't actually need to supply a version number, but if you do, you can control when the cache breaks, eg if a package has installed new assets) or to 'AppDomain'.
:::

Another configuration option is the `"dataFolder`" setting, this setting specifies what folder Smidge will use for its temporary data, it should not be necessary to change this either.
Another configuration option (of Smidge) is the `"dataFolder`" setting, this setting specifies what folder Smidge will use for its temporary data, it should not be necessary to change this either, it will only be used if UseInMemoryCache is set to false.