Slow editing pages when using the Iconpicker widget

Created on 4 July 2023, over 1 year ago
Updated 7 July 2023, over 1 year ago

Problem/Motivation

When using the Iconpicker Widget, the website becomes very slow when loading a page containing this widget.
The issues lies at a wrong cache handling inside the module, which causes multiple requests on a single pageload to retrieve the list of possible icons from fontawesome, while it should keep a weekly cache of this library (which invalidates sooner with Drush CR).

Steps to reproduce

Add a font awesome field on your content type, go to the form display settings and select the "Font Awesome Iconpicker Widget".
Then create or modify an instance of this content type. The page in some projects, takes seconds to load.

Proposed resolution

The solution is to replace the cache.data implementation by a custom cache bin, which is also a better practice to keep the cache of this module separate from other caches. The proposed patch will only require a cache clear to make the cache table available, and a single pageload to fill in the cache for a week :)

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium hoebekewim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024