diff --git a/config/application.yml.example b/config/application.yml.example index 96da545127..24ac9068fb 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -56,3 +56,5 @@ SMTP_PASSWORD: 'f00d' # STRIPE_INSTANCE_PUBLISHABLE_KEY: "pk_test_xxxx" # This can be a test key or a live key # STRIPE_CLIENT_ID: "ca_xxxx" # This can be a development ID or a production ID # STRIPE_ENDPOINT_SECRET: "whsec_xxxx" + +MEMCACHED_VALUE_MAX_MEGABYTES: 4 diff --git a/config/environments/production.rb b/config/environments/production.rb index 3d7803772d..af72e56b7d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -40,7 +40,9 @@ Openfoodnetwork::Application.configure do # config.logger = SyslogLogger.new # Use a different cache store in production - config.cache_store = :dalli_store + memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i + memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024 + config.cache_store = :dalli_store, { value_max_bytes: memcached_value_max_bytes } # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" diff --git a/config/environments/staging.rb b/config/environments/staging.rb index b0e1b96301..936897b31b 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -40,7 +40,9 @@ Openfoodnetwork::Application.configure do # config.logger = SyslogLogger.new # Use a different cache store in production - config.cache_store = :dalli_store + memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i + memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024 + config.cache_store = :dalli_store, { value_max_bytes: memcached_value_max_bytes } # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com"