Skip to content

changes to performance pages #56

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

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions usync/01.uSync/20.guides/90.performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,17 @@ Occasionally an update in Umbraco or uSync functionality will cause us to make a
Checks are always faster then import operations, To minimize "false positives" in uSync when checking files, perform clean exports after you upgrade uSync minor versions (e.g 10.0 -> 10.1).
:::

## Use Flat Folders and Guid Filenames
Switching to guid file names will reduce the amount of checks that uSync needs to perform when an item is saved or deleted. Flat folders reduce the need to check multiple folders when an item is moved in Umbraco.

:::tip
Switching to guid file names on a large site will can have an impact on save/update times.
:::

## Don't Sync Content/Media If You Don't Need to.
The default configuration for uSync will sync content and media items to disk when they are saved. If you are not going to use 'standard' uSync to sync content (e.g via the uSync dashboard) then you can turn off the content and media sync.

The drawback is if you make any changes to the production site directly, they will be lost, and you will be back to doing a side by side comparison of items in the browser. In the perfect world, no one touches production, but it can happen.

:::note
If you are using uSync.Complete and uSync.Publisher to push and pull your content between sites you can turn off the default Content/Media as the the files in the uSync/v9 folder are not used for this process.
:::

:::tip
To only sync settings to disk you can set the `ExportOnSave` setting to `Settings` in the `appsettings.json` file:
If you only want to sync settings to disk you can set the `ExportOnSave` setting to `Settings` in the `appsettings.json` file:

```json title="appsettings.json"
{
Expand All @@ -54,8 +49,41 @@ To only sync settings to disk you can set the `ExportOnSave` setting to `Setting
```
:::

## Use Flat Folders and Guid Filenames
By default, when you save an item, uSync checks on disk to see if the item has been renamed.

The default is to store the uSync file using the name or alias of an item, which makes it easier to view when looking at changes in source control.

However, this means that when an item is renamed, the filename changes. uSync then has to scan the files to find what the old file was called and mark it as a rename in the new file.

If you have lots of content, this can mean a *lot* of scanning the folders looking for the changes.
So you can remove this rename file scan by using the `UseFlatStructure" and "GuidNames" settings

```
"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"UseFlatStructure": true,
"GuidNames": true,
}
}
}
}
```
Switching to guid file names will reduce the amount of checks that uSync needs to perform when an item is saved or deleted. Flat folders reduce the need to check multiple folders when an item is moved in Umbraco.

With these two settings, things will be saved to disk using the items key (GUID) as the filename, so when an items is renamed or moved the actual file doesn't get renamed or moved. This way, uSync doesn't perform the scan of files, which will reduce disk traffic on a large site significantly.

The disadvantage here is that files become hard to recognise manually, and changes are harder to visually track but this is not always a big issue, depending on how you are managing your site.

:::tip
Switching to guid file names on a large site can have an impact on save/update times.
:::


## Don't Import at Startup
For uSync v9+ Import at Startup is off by default, but if turned on on a large import during startup it can impact the start times for your site. While a sync might only take a few seconds, during this time the site will still be 'booting' and may not be available to users.
From uSync v9 Import at Startup is off by default, but if turned on on a large import during startup it can impact the start times for your site. While a sync might only take a few seconds, during this time the site will still be 'booting' and may not be available to users.

:::tip
Ensure Import at Startup is off for your site.
Expand Down