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 :)
Comment | File | Size | Author |
---|---|---|---|
#2 | font-awesome-cache-bin-3372324-1.patch | 680 bytes | hoebekewim |
Comments
Comment #2
hoebekewim CreditAttribution: hoebekewim at SQLI - Belgium commentedUploading patch.
Comment #3
hoebekewim CreditAttribution: hoebekewim at SQLI - Belgium commentedComment #4
jeroenbegyn CreditAttribution: jeroenbegyn at SQLI commentedLooks good to me!
Comment #5
jeroenbegyn CreditAttribution: jeroenbegyn at SQLI commentedComment #7
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedCommitted. Thank you for the patch!