Thanks for the suggestion, it does exactly what I need.

It also appears to work ok through caching proxies too.