Some performance changes

Changed to request a HttpResponse only when necessary. Changed also to
return the last cached version if it was not possible to connect with
the server.