I think you are looking for ICAP or ECAP. I have worked with proxies but have not done anything with either of these yet.
Content Adaptation (ICAP, ECAP, and others which are not as promising in my opinion) http://wiki.squid-cache.org/SquidFaq/ContentAdaptation