Fragment Caching in Rails 7.1+ requires Haml 6

Rails slightly changed the fragment cache implementation from Rails 7.0 Show archive.org snapshot to Rails 7.1 Show archive.org snapshot . Unfortunately, this is incompatible with how Haml 5 patches Action View buffers Show archive.org snapshot . I tried turning a String buffer into an ActionView::OutputBuffer, but this brought up other issues.

Conclusion

While we have a Rails 7.2 application successfully running with Haml 5, Rails applications with fragment caching need to upgrade to Haml 6 when upgrading to Rails 7.1.

Dominik Schöler