Using L7 to conditionally forward to proxy

We need to do content filtering and/or manipulation using a remotely-hosted transparent proxy + ICAP server. I understand that the RouterOS web proxy can forward all port 80 traffic to a parent proxy, but, because the remote proxy is on AWS, the bandwidth costs would be quite expensive.

I’d like to use an L7 filter to forward only requests for HTML documents to my remote proxy (perhaps scanning for “text/html” in the “Accept” request header sent by the browser). So the initial GET request for google.com (for example) will be forwarded to the remote proxy, but all subsequent requests for assets referenced in the returned HTML doc (CSS, JS, image files, etc) will not go through the proxy.

I’m getting different answers from two potential consultants as to whether or not this would work. It doesn’t need to be perfect, just possible. Can anyone clarify if this is something the RouterOS firewall can accomplish?