This is the typical flow for formatting a price:

commerce_currency_format() -> commerce_currency_load() -> commerce_currencies() -> cache_get()

We need a static cache in commerce_currencies().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Active » Needs review
FileSize
3.72 KB
rszrama’s picture

I'm happy to commit this as is (works fine on testing), but I'm wondering if we really need to statically cache the list of enabled currencies; specifically, is there a noticeable tradeoff in skipping array_intersect_key() on the full currencies array vs. storing what could be up to an exact duplicate of currency data in memory? It makes the function harder to follow when the statically cached data doesn't match up to the database cache.

rszrama’s picture

Status: Needs review » Fixed

Committed as is.

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