Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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()
.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1363808-commerce-currencies-static-cache.patch | 3.72 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #2
rszrama CreditAttribution: rszrama commentedI'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.
Comment #3
rszrama CreditAttribution: rszrama commentedCommitted as is.