Add support for the stale-while-revalidate and stale-if-error extensions to the Cache-Control response header. Supporting them will make it easier to utilize reverse proxies and CDNs from Rails without resorting to hacks.
This PR optimises ActiveRecord::Result#cast_values to avoid creating temporary arrays, reducing the number of objects allocated to 1 per row retrieved. Benchmark show that the new version is up to 1.5x faster.
You can now specify the default expiry of URLs generated by Active Storage by setting config.active_storage.service_urls_expire_in. The default is 5 minutes.
The touch option recently added to increment! in Active Record was not updating update_at/on attributes when passed attribute names. The behavior has now been fixed.
This method (and transform_values!) was not consistently returning an instance of ActionController::Parameters. This PR (from a first-time contributor!) fixes it.
Wrapping Up
18 people contributed to Rails this past week, including 2 first-time contributors. Check out the list of open issues!
Among other news, a security vulnerability was disclosed this week so update Sprockets to the latest version if you haven't yet.
Oh, and my talk about Active Storage at RailsConf 2018 is finally on YouTube. 🤗 Have a great weekend!
This Week in Rails · 30 N Racine #200 · Chicago IL 60607 · USA