mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
We found that our database is quite busy querying the country all the time. One source of these queries is the shop front which serializes enterprises including their addresses. But addresses should be safe to cache because: - country records never change - state records never change - updating any other attribute changes the cache key The caching was previously removed when the state_name attribute was added. That is technically correct because it's possible to change a state's name without updating the address. Then the cache would be out of date. But we never update state names. And if we did, we would need to invalidate the cache now.