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 :)

CommentFileSizeAuthor
#2 font-awesome-cache-bin-3372324-1.patch680 byteshoebekewim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hoebekewim created an issue. See original summary.

hoebekewim’s picture

Uploading patch.

hoebekewim’s picture

Status: Active » Needs review
jeroenbegyn’s picture

Looks good to me!

jeroenbegyn’s picture

Status: Needs review » Reviewed & tested by the community

Daniel.Moberly’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.