diff --git a/config/environments/development.rb b/config/environments/development.rb index 14f3377f7..32a81aad6 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,6 +6,9 @@ Zammad::Application.configure do # since you don't have to restart the web server when you make code changes. config.cache_classes = false + # Do not eager load code on boot. + config.eager_load = false + # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false @@ -16,8 +19,8 @@ Zammad::Application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin + # Raise an error on page load if there are pending migrations + config.active_record.migration_error = :page_load # Do not compress assets config.assets.compress = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 4c418a760..e57a56520 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,6 +4,12 @@ Zammad::Application.configure do # Code is not reloaded between requests config.cache_classes = true + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both thread web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true @@ -14,14 +20,18 @@ Zammad::Application.configure do # Compress JavaScripts and CSS config.assets.compress = true + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = false # Generate digests for assets URLs config.assets.digest = true - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH + # Version of your assets, change this if you want to expire all your assets. + config.assets.version = '1.0' # Specifies the header that your server uses for sending files # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache @@ -32,6 +42,7 @@ Zammad::Application.configure do # See everything in the log (default is :info) # config.log_level = :debug + config.log_level = :info # Prepend all log lines with the following tags # config.log_tags = [ :subdomain, :uuid ] @@ -51,9 +62,6 @@ Zammad::Application.configure do # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false - # Enable threaded mode - # config.threadsafe! - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true @@ -61,6 +69,12 @@ Zammad::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + # autoload on config.dependency_loading = true + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new end diff --git a/config/environments/test.rb b/config/environments/test.rb index 37bab79d2..970488c3b 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -7,6 +7,11 @@ Zammad::Application.configure do # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + # Configure static asset server for tests with Cache-Control for performance config.serve_static_assets = true config.static_cache_control = "public, max-age=3600"