Yeah there could be some kind of “varnish-like” layer outside the app server designed to modify the response to the required “lens” that is specified in a header.
This would process the app response and filters/zoom to the part of the doc you want. The app could be agnostic and it reduces the amount of crap sent over the wire.