Introduce cache-ability metadata on auto-complete

Created on 6 November 2019, about 5 years ago
Updated 9 May 2024, 7 months ago

Problem/Motivation

When there are plenty of editors and plenty of content on a given website, the Linkit module's autocomplete starts to take too much system time.

It has all the capabilities to be fully cache-able, but based on current implementation it is not, causing repeated search queries to be re-evaluated all the time.

Proposed resolution

Introduce Drupal's cache meta-data aggregation for the auto-complete.
Consider render API cache contexts / etc, so we can have page cache or dynamic page cache take over the repeated autocomplete searches.

High level plan:
- Introduce cache metadata on the suggestions object. Add entity cache meta-data on the suggestion creation.
- Aggregate the cache meta-data on the suggestions list. Add suggestion tags on the list object during addition.
- Propagate that on the response returned from the controller. Return CacheableJsonResponse instead of the currently used JsonResponse one.

Remaining tasks

Discussion, patch etc.

User interface changes

None expected - this is pure internals.

API changes

Auto-complete requests will be cache-able now.

Data model changes

None.

Release notes snippet

Mention it in the release.

✨ Feature request
Status

Closed: won't fix

Version

5.0

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria ndobromirov

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    For some time now, as indicated by the Linkit project page β†’ , the 8.x-5.x branch of Linkit is not undergoing active development. It is also only compatible with unsupported versions of Drupal core (Drupal 8 and Drupal 9).

    To help the maintainers of the Linkit module better steward tasks under active development, I'm going to mark this issue as closed (wontfix). Sites using 8.x-5.x can certainly continue to do so, but should make plans for updating to the latest supported version of Linkit.

    Even better: Drupal core will soon provide link autocomplete suggestions in CKEditor similar to what this module does. Sites using or considering using Linkit should follow this core issue ✨ Drastically improve the linking experience in CKEditor 5 Needs work to evaluate whether they can use the core solution instead of Linkit. See feature differences below to compare what Linkit includes that will not initially be in Drupal core.

    If this issue relates to a problem or feature request that is applicable to the latest supported version of Linkit, please create a new issue, associated with that branch, describing the bug or enhancement.

    For participation and information in Linkit's roadmap, see 🌱 LinkIt Release Roadmap and Issue Prioritization Active .

    Thanks, community, for you collaboration and consideration!

Production build 0.71.5 2024