Skybrud.Umbraco.Redirects
Skybrud.Umbraco.Redirects copied to clipboard
Add database indexes
The SkybrudRedirects
table should get some database indexes, as retrieving rows currently scans the whole table and that can take quite some time, especially when a lot of redirects are added...
The built-in Umbraco umbracoRedirectsUrl
table indexes a hash of the URL, together with the resulting content/node key, culture and creation date. This ensures the index isn't unneccesary large and sorting on most recently added redirect can also be done efficiently within the database.
@ronaldbarendse thanks for creating this issue. It may not make as much sense if a cache layer is introduced, but I'll keep it in mind 👍
Caching won't make it faster, as it still needs to get the data from the database. Loading all redirects into the cache also isn't efficient (especially with large amounts of redirects) and an anti-pattern, as you should only cache frequently used objects.