Right now the way the Marten::Middleware::AssetServing middleware behaves can't be configured. This middleware hardcodes the max age of served assets (3600 seconds), and it is not possible to easily override it if necessary. Let's ensure that this value can be configured easily.
Proposition
Let's introduce a new assets.max_age setting. This setting should allow setting the max age as used in the Cache-Control header set by the Marten::Middleware::AssetServing middleware, and the default value should be 3600s. It should be made clear in the documentation that this setting only applies when the Marten::Middleware::AssetServing middleware is enabled.
Description
Right now the way the
Marten::Middleware::AssetServing
middleware behaves can't be configured. This middleware hardcodes the max age of served assets (3600 seconds), and it is not possible to easily override it if necessary. Let's ensure that this value can be configured easily.Proposition
Let's introduce a new
assets.max_age
setting. This setting should allow setting the max age as used in theCache-Control
header set by theMarten::Middleware::AssetServing
middleware, and the default value should be 3600s. It should be made clear in the documentation that this setting only applies when theMarten::Middleware::AssetServing
middleware is enabled.