added a timeout to avoid blocking even when fetching resources from cache (on webkit)