Are these sites that you manage? If it takes forever, then it's probably
simply because of the time required for each server to serve up the page.
If you have control of the sites you could place a simple CF template
(assuming you want to check that CF is also still functioning) on each site.
Retrieve that page instead of, say, the main page of the web site. Should
make the transfer a bit faster. Then you could test both the
cfhttp.statuscode as well as parse the page contents and look for some
specific generated content.
If you still need to break it down, you could keep an application variable
that contains the primary key of the last record you processed. Then the
next time you process a bunch use a query something like:
SELECT TOP 20 *
FROM mysites
WHERE mysite_id > #application.lastsite_id#
Then update the application variable.
Jim
----- Original Message -----
From: "Marc Garrett" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 10:24 AM
Subject: checking whether sites are available
> I have a database of a few hundred sites. I'd like to use CF to
automatically check to see whether the sites are up so I don't have to do it
by hand. The solution I came up with is to use cfhttp.statuscode to check
whether the site is up. I loop through the list and update the database
accordingly. My code works, but it takes forever. Two questions:
>
> 1) Is there a way I can break the site list into chunks, and have the
template check the statuscode of 20 sites at a time instead of all of them?
I recall someone suggesting this solution for sending thousands of emails
with CFMAIL, but I couldn't find that post in the archives.
>
> 2) Is there a better way of doing this instead of cfhttp.statuscode?
>
> Thanks for any assistance.
>
> Marc Garrett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists