Problem/Motivation
We have a leaflet view listing dozens of nodes with the same marker icon and we noticed that Drupal is fetching this icon with an HTTP request for each node.
It seems setFeatureIconSizesIfEmptyOrInvalid() is called on each feature even if the icon is always the same.
Steps to reproduce
- Create a leaflet view that returns several results.
- Set
iconURLto a static PNG file. - Watch the server logs.
Proposed resolution
We could add static cache to only fetch each icon file once.
Issue fork leaflet-3312282
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
Comment #3
prudloff commentedComment #5
itamair commentedComment #9
itamair commentedVery nice catch @prudloff ... definitely an improvement to implement.
But I had to struggle with your MR, that I closed as it was applying to the 2.1.x (and even not clean to the dev head) that is not supported any more. Also some of your code couldn't work properly to me, such as:
I had to fix it and apply/commit into the 2.2.x branch with this: https://git.drupalcode.org/project/leaflet/commit/9b22df8
This is going to be part of the new 2.2.10 release ...
(please better QA and Test new MRs when you provide ... )