Problem/Motivation

Redirect destination paths are stored in the redirect table as URIs, for example:

internal:/node/123
entity:/node/456
internal:/search/site/

These URIs must be transformed into the correct internal paths or path aliases, as the REST resource needs to return the final, human-readable alias to the front end.

Resolving them through Drupal's URL system (for example, using Url::fromUri()) requires bootstrapping a large portion of Drupal and triggers multiple additional operations. When processing a large number of redirects, this introduces a significant performance overhead and becomes a major bottleneck.

Proposed resolution

Implement an approach based on chunked queries to the path_alias table to resolve destination URIs that use the internal and entity schemes, avoiding the need to invoke Drupal's full URL resolution system.

User interface changes

None.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

camilo.escobar created an issue. See original summary.

camilo.escobar’s picture

Issue summary: View changes
camilo.escobar’s picture

Title: Performance improvement: work directly with the raw URI values instead of using Drupal's URL system » Performance improvement: Perform direct lookups of path aliases using raw URI values, avoiding Drupal's URL system.
camilo.escobar’s picture

Status: Active » Fixed

Fixed and tagged as 1.0.1.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

camilo.escobar’s picture

Status: Fixed » Closed (fixed)