def _cache_shop_configuration(shop):
 configuration = {}
 configuration.update(_get_configuration_from_db(None))
 if shop:
  configuration.update(_get_configuration_from_db(shop))
 cache.set(_get_cache_key(shop), configuration)
 return configuration

def _cache_shop_configuration ( shop ) : configuration = { } configuration . update ( _get_configuration_from_db ( None ) ) if shop : configuration . update ( _get_configuration_from_db ( shop ) ) cache . set ( _get_cache_key ( shop ) , configuration ) return configuration
cache global or shop specific configuration .