When there are multiple nodes on a page, i.e. node reference or term reference,
the function metatag_entity_view() gets called for every single entity.
To improve the performance, I suggest a static variable is create to avoid doing all the work after the metatags are loaded and stored in $entity->content['metatags'].
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | metatag-n1796916-3.patch | 1.09 KB | damienmckenna |
| #2 | optimize-metatag-entity-view-1796916.patch | 1007 bytes | marcelovani |
| #1 | optimize-metatag-entity-view-1796916.patch | 1010 bytes | marcelovani |
Comments
Comment #1
marcelovaniHere is the patch
Comment #2
marcelovaniRe-patched the file. This patch works on current dev version.
Comment #3
damienmckennaHow about this instead - the function already had all of the necessary code, and there's no guarantee that the entities will be loaded in the order your patch assumes.
Comment #4
marcelovani@DamienMcKenna Works well and is much simpler than my solution :)
Comment #5
damienmckennaWill be reviewed next.
Comment #6
damienmckennaDid the tag break?
Comment #7
damienmckennaCommitted.
Comment #8
damienmckennaLast night saw the release of 7.x-1.0-beta1, so I'm closing all these "fixed" issues in the interest of tidying up the issue queue. Thank you all for your help getting us to this point!
Comment #9
damienmckenna