+ # Cache assets for far-future expiry since they are all digest stamped.
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
- # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
- # config.assume_ssl = true
+ config.assume_ssl = true
Rails 8.0におけるpublic_file_server.headersとassume_ssl
rails new
で生成されるconfig/environments/production.rbにおいて、 8.0からは以下の設定2つが追加されているのですが(この変更のPRとこの変更のCommit)、 これは8.0からrails new
で生成されるアプリでKamal 2対応が行われていることに起因するものです。ですので既存アプリでは、Kamal 2対応をしないのであればこれらの設定の追加はしなくても良いと思われます。