Add cache_if! to conditionally cache JSON fragments