diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 8fb28ec..9a77c4d 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -32,6 +32,10 @@
 #include "soup-ssl.h"
 #include "soup-uri.h"
 
+#ifdef HAVE_GNOME
+#include "soup-gnome-features.h"
+#endif
+
 /**
  * SECTION:soup-session
  * @short_description: Soup session state object
@@ -809,16 +813,12 @@ soup_session_host_new (SoupSession *session, SoupURI *uri)
 	return host;
 }
 
-/* Note: get_host_for_message doesn't lock the host_lock. The caller
- * must do it itself if there's a chance the host doesn't already
- * exist.
- */
+/* Requires host_lock to be locked */
 static SoupSessionHost *
-get_host_for_message (SoupSession *session, SoupMessage *msg)
+get_host_for_uri (SoupSession *session, SoupURI *uri)
 {
 	SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
 	SoupSessionHost *host;
-	SoupURI *uri = soup_message_get_uri (msg);
 
 	host = g_hash_table_lookup (priv->hosts, uri);
 	if (host)
@@ -830,6 +830,16 @@ get_host_for_message (SoupSession *session, SoupMessage *msg)
 	return host;
 }
 
+/* Note: get_host_for_message doesn't lock the host_lock. The caller
+ * must do it itself if there's a chance the host doesn't already
+ * exist.
+ */
+static SoupSessionHost *
+get_host_for_message (SoupSession *session, SoupMessage *msg)
+{
+	return get_host_for_uri (session, soup_message_get_uri (msg));
+}
+
 static void
 free_host (SoupSessionHost *host)
 {
@@ -1515,6 +1525,54 @@ soup_session_abort (SoupSession *session)
 }
 
 /**
+* soup_session_prepare_for_uri:
+* @session: a #SoupSession
+* @uri: a #SoupURI which may be required
+*
+* Tells @session that @uri may be requested shortly, and so the
+* session can try to prepare (resove domain name, obtain proxy
+* address, etc.) in order to work more quickly once the URI is really
+* requested.
+*
+* This method acts asynchronously, in @session's %async_context.
+* If you are using #SoupSessionSync and do not have a main loop running,
+* then you can't use this method.
+*
+* Since: 2.30
+**/
+void
+soup_session_prepare_for_uri (SoupSession *session, SoupURI *uri)
+{
+	SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
+	SoupSessionHost *host;
+	SoupAddress *addr;
+
+	SoupSessionFeature *feature;
+
+	/* Check for proxy */
+	feature = soup_session_get_feature (session, SOUP_TYPE_PROXY_RESOLVER);
+	#ifdef HAVE_GNOME
+	if (!feature)
+		feature = soup_session_get_feature (session, SOUP_TYPE_PROXY_RESOLVER_GNOME);
+	#endif
+	if (!feature)
+		feature = soup_session_get_feature (session, SOUP_TYPE_PROXY_RESOLVER_STATIC);
+	if (!feature)
+		feature = soup_session_get_feature (session, SOUP_TYPE_PROXY_URI_RESOLVER);
+
+	if (feature == NULL) {
+		g_mutex_lock (priv->host_lock);
+		host = get_host_for_uri (session, uri);
+		addr = g_object_ref (host->addr);
+		g_mutex_unlock (priv->host_lock);
+
+		soup_address_resolve_async (addr, priv->async_context,
+					    NULL, NULL, NULL);
+	}
+
+}
+
+/**
  * soup_session_add_feature:
  * @session: a #SoupSession
  * @feature: an object that implements #SoupSessionFeature
diff --git a/libsoup/soup-session.h b/libsoup/soup-session.h
index 598ee45..6080008 100644
--- a/libsoup/soup-session.h
+++ b/libsoup/soup-session.h
@@ -93,6 +93,8 @@ void            soup_session_cancel_message   (SoupSession           *session,
 					       guint                  status_code);
 void            soup_session_abort            (SoupSession           *session);
 
+void            soup_session_prepare_for_uri  (SoupSession           *session,
+					       SoupURI               *uri);
 
 void                soup_session_add_feature            (SoupSession        *session,
 							 SoupSessionFeature *feature);
