jbuilder
jbuilder copied to clipboard
cache! force option ignored?
In versions 2.5.0 and older you could do
json.cache! "key_name", expires_in: 10.minutes, force: force? do
where force? is a method that returns a boolean. If force was true then rails would generate and write the cache. This is broken when I upgrade to 2.6 and greater.
I tried using cache_if! as a workaround but it doesn't expire the cache. Is this a bug or an intentional change?
Here is the merge that broke it https://github.com/rails/jbuilder/commit/65dfb3305b1c1ebae550c420a6ab6bd0e21271ec It went from using cache.fetch (which takes the force option) to using cache.read and cache.write