if called without session ID create new session id use this id to cache a data stub (with "expect-more-data" flag set) fork if parent respond with a 302 redirect whose URL is the script URL + the session ID exit if child repeat for i in 1..20 sleep 1 second add "i\n" to the cached data unset the "expect-more-data" flag in the cached data object exit else (i.e. session ID available) retrieve cached data if "expect-more-data" flag is set add "...continuing..." at the end of the response add to the response's header display a page with the newly retrieved data