|
9 | 9 | # Code is not reloaded between requests. |
10 | 10 | config.enable_reloading = false |
11 | 11 |
|
12 | | - # Eager load code on boot. This eager loads most of Rails and |
13 | | - # your application in memory, allowing both threaded web servers |
14 | | - # and those relying on copy on write to perform better. |
15 | | - # Rake tasks automatically ignore this option for performance. |
| 12 | + # Eager load code on boot for better performance and memory savings (ignored |
| 13 | + # by Rake tasks). |
16 | 14 | config.eager_load = true |
17 | 15 |
|
18 | | - # Full error reports are disabled and caching is turned on. |
19 | | - config.consider_all_requests_local = false |
20 | | - config.action_controller.perform_caching = true |
21 | | - |
22 | | - # Ensures that a master key has been made available in |
23 | | - # ENV["RAILS_MASTER_KEY"], config/master.key, or an environment key such as |
24 | | - # config/credentials/production.key. This key is used to decrypt credentials |
25 | | - # (and other encrypted files). |
26 | | - # config.require_master_key = true |
| 16 | + # Full error reports are disabled. |
| 17 | + config.consider_all_requests_local = false |
27 | 18 |
|
28 | | - # Enable static file serving from the `/public` folder (turn off if using |
29 | | - # NGINX/Apache for it). |
30 | | - config.public_file_server.enabled = true |
31 | | - |
32 | | - # Compress CSS using a preprocessor. |
33 | | - # config.assets.css_compressor = :sass |
| 19 | + # Turn on fragment caching in view templates. |
| 20 | + config.action_controller.perform_caching = true |
34 | 21 |
|
35 | | - # Do not fallback to assets pipeline if a precompiled asset is missed. |
36 | | - config.assets.compile = false |
| 22 | + # Cache assets for far-future expiry since they are all digest stamped. |
| 23 | + config.public_file_server.headers = { |
| 24 | + "cache-control" => "public, max-age=#{Integer(1.year, 10)}" |
| 25 | + } |
37 | 26 |
|
38 | 27 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
39 | 28 | # config.asset_host = "http://assets.example.com" |
40 | 29 |
|
41 | | - # Specifies the header that your server uses for sending files. |
42 | | - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache |
43 | | - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX |
44 | | - |
45 | 30 | # Assume all access to the app is happening through a SSL-terminating reverse |
46 | | - # proxy. Can be used together with config.force_ssl for |
47 | | - # Strict-Transport-Security and secure cookies. |
48 | | - # config.assume_ssl = true |
| 31 | + # proxy. |
| 32 | + config.assume_ssl = true |
49 | 33 |
|
50 | 34 | # Force all access to the app over SSL, use Strict-Transport-Security, and |
51 | 35 | # use secure cookies. |
52 | 36 | config.force_ssl = true |
53 | 37 |
|
54 | | - # Log to STDOUT by default |
55 | | - logger = ActiveSupport::Logger.new($stdout) |
56 | | - logger.formatter = Logger::Formatter.new |
57 | | - config.logger = ActiveSupport::TaggedLogging.new(logger) |
| 38 | + # Skip http-to-https redirect for the default health check endpoint. |
| 39 | + # config.ssl_options = |
| 40 | + # { redirect: { exclude: ->(request) { request.path == "/up" } } } |
58 | 41 |
|
59 | | - # Prepend all log lines with the following tags. |
| 42 | + # Log to STDOUT with the current request id as a default log tag. |
60 | 43 | config.log_tags = [:request_id] |
| 44 | + config.logger = ActiveSupport::TaggedLogging.logger($stdout) |
61 | 45 |
|
62 | | - # Info include generic and useful information about system operation, but |
63 | | - # avoids logging too much information to avoid inadvertent exposure of |
64 | | - # personally identifiable information (PII). If you want to log everything, |
65 | | - # set the level to "debug". |
| 46 | + # Change to "debug" to log everything (including potentially |
| 47 | + # personally-identifiable information!) |
66 | 48 | config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") |
67 | 49 |
|
68 | | - # Use a different cache store in production. |
| 50 | + # Prevent health checks from clogging up the logs. |
| 51 | + config.silence_healthcheck_path = "/up" |
| 52 | + |
| 53 | + # Don't log any deprecations. |
| 54 | + config.active_support.report_deprecations = false |
| 55 | + |
| 56 | + # Replace the default in-process memory cache store with a durable |
| 57 | + # alternative. |
69 | 58 | # config.cache_store = :mem_cache_store |
70 | 59 |
|
71 | | - # Use a real queuing backend for Active Job (and separate queues per |
72 | | - # environment). |
73 | | - # config.active_job.queue_adapter = :resque |
74 | | - # config.active_job.queue_name_prefix = "stringer_production" |
| 60 | + # Replace the default in-process and non-durable queuing backend for Active |
| 61 | + # Job. |
| 62 | + # config.active_job.queue_adapter = :resque |
75 | 63 |
|
76 | 64 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to |
77 | 65 | # the I18n.default_locale when a translation cannot be found). |
78 | 66 | config.i18n.fallbacks = true |
79 | 67 |
|
80 | | - # Don't log any deprecations. |
81 | | - config.active_support.report_deprecations = false |
82 | | - |
83 | 68 | # Do not dump schema after migrations. |
84 | 69 | config.active_record.dump_schema_after_migration = false |
85 | 70 |
|
| 71 | + # Only use :id for inspections in production. |
| 72 | + config.active_record.attributes_for_inspect = [:id] |
| 73 | + |
86 | 74 | # Enable DNS rebinding protection and other `Host` header attacks. |
87 | 75 | # config.hosts = [ |
88 | 76 | # "example.com", # Allow requests from example.com |
89 | 77 | # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` |
90 | 78 | # ] |
| 79 | + # |
91 | 80 | # Skip DNS rebinding protection for the default health check endpoint. |
92 | 81 | # config.host_authorization = |
93 | 82 | # { exclude: ->(request) { request.path == "/up" } } |
|
0 commit comments