cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Curl instance against web browser

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Mar 2009 11:24:47 +0100 (CET)

On Sun, 1 Mar 2009, jom dalina wrote:

> does opening a curl session equivalent to opening a browser instance (e.g.
> opening a firefox browser)?
>
> if so, after scraping a web page, without closing the curl session and
> scrape another web page, does it consider the same browser instance opened
> or it is it consider another browser instance? (e.g. like closing the
> previously opened browser and opening a new one)

Yes and no.

HTTP is stateless so there's no difference to a web site if you do one
request, then close your browser, start it again and then do the next request.

But a TCP connection to a server can be re-used for multiple requests which
makes the subsequent ones faster and CURL/PHP can do that as well as your
browser.

Then there's also stuff like cookies, but that has nothing to do with the TCP
connection and CURL/PHP can do them fine disregarding if you re-use a handle
or not.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-03-02