# Set custom options such as cache control to leverage browser caching
config.aws_attributes = {
expires: 1.week.from_now.httpdate,
cache_control: 'max-age=604800'
}
However, the statement 1.week.from_now.httpdate will return a static, absolute timestamp which is then merged verbatim into the request. So when an application runs for a couple of days, the expires string will move closer and closer, eventually even moving into the past.
It should be straightforward to also have this support a lambda or Proc instead of a static hash, so it can be evaluated on every request. What do you think about this?
The README states
However, the statement
1.week.from_now.httpdate
will return a static, absolute timestamp which is then merged verbatim into the request. So when an application runs for a couple of days, theexpires
string will move closer and closer, eventually even moving into the past.It should be straightforward to also have this support a lambda or Proc instead of a static hash, so it can be evaluated on every request. What do you think about this?