new methods: capture, get_cached_file, cache_file