It isn't
really possible in Servlets, except as Frank said by caching the data locally first then writing to both the file system and the client at the same time. It's a lot of work though.
You can do it using tags in JSPs and I beieve there is already a caching tag created, although personally I haven't even looked at it. Tags have an extra feature foreign to Servlets, where it is sometimes necessary to cache the entire page, and you can use this feature to retain a local copy of responses to clients.
At least I hear you can, it isn't something I'm interested in trying...
Dave