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

Determine urls at save and publish time #17033

Merged

Conversation

bergmania
Copy link
Member

@bergmania bergmania commented Sep 10, 2024

Description

This PR introduces a new content finder that finds content by url, but the urls are persisted on save/publish time instead of determined on runtime using NuCache.

Details

A new IDocumentUrlService has been introduced. It keeps an local cache with all url segments, that is seeded on boot. To insure this, a DocumentUrlServiceInitializer has been introduced, that executes on boot as a hosted service. It checks if the all urls needs to be rebuilt, in caches where the UrlSegmentProviderCollection has changed. Otherwise it just loads in the urls from the database.

The document urls are updated using the ContentCacheRefresher to ensure updates happens on all servers.

When the content finder is used, it rely on the IDocumentNavigationQueryService to navigate the ancestors. This is only intended to happen from the website-serveres. There is also a method to get all urls for a given content Id. This is intended to be used from backoffice, and do not rely on IDocumentNavigationQueryService.

For the database, I had to introduce a new index type, that we have not used before The Unique Clusted index.

Test

  • Migrate an existing structure
  • Introduce a custom IUrlSegmentProvider and verify the urls are updated on boot
  • Test using the umbracoUrlName property name that will override the name when generating the url segment

…eature/determine-urls-at-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…eature/determine-urls-at-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…-3gvx/v14/dev' into v14/feature/determine-urls-at-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…eature/determine-urls-at-publish-time

# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
#	src/Umbraco.Web.UI.Client
…blish-time' into v15/feature/determine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…eature/determine-urls-at-save-and-publish-time

# Conflicts:
#	global.json
…ine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
@bergmania bergmania marked this pull request as ready for review September 23, 2024 06:19
…ine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…ine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
…ine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs
#	src/Umbraco.Web.UI.Client
…ine-urls-at-save-and-publish-time

# Conflicts:
#	src/Umbraco.Web.UI.Client
@nikolajlauridsen nikolajlauridsen merged commit 734b3cc into v15/dev Sep 27, 2024
10 of 17 checks passed
@nikolajlauridsen nikolajlauridsen deleted the v15/feature/determine-urls-at-save-and-publish-time branch September 27, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants