Optimiseinputstream

The assumption here is that the baseUrl will not change.