Closed Edouard-chin closed 4 years ago
If your cache_miss_block returns a falsy value, it would result in in being called twice due to this check https://github.com/Shopify/cacheable/blob/6626bedf057d4f95c01e0dce57426f39d167ff58/lib/cacheable/response_cache_handler.rb#L46
This regression was introduced by https://github.com/Shopify/cacheable/pull/36
Fix is to check whether the block mutated the response_body before calling the block another time.
response_body
If your cache_miss_block returns a falsy value, it would result in in being called twice due to this check https://github.com/Shopify/cacheable/blob/6626bedf057d4f95c01e0dce57426f39d167ff58/lib/cacheable/response_cache_handler.rb#L46
This regression was introduced by https://github.com/Shopify/cacheable/pull/36
Fix is to check whether the block mutated the
response_body
before calling the block another time.