Skip to main content
October 16, 2009
Question

CFHTTP running longer than Timeout specified

  • October 16, 2009
  • 2 replies
  • 1519 views

I'm using ColdFusion 5 and specifying a timeout=2 on the CFHTTP tag.   I'm doing an HTTP Get on a remote site, grabbing an XML feed.

Somestimes the CFHTTP runs much longer than the 2 second timeout I've specificed on the <cfhttp> tag.  I thought the  timeout parameter was the max time the CFHTTP would execute. 

We really need to be able to stop the CFHTTP at the timeout we specify, and not allow it to continue processing and hold  up the page.

Can anyone help with this?

    This topic has been closed for replies.

    2 replies

    October 18, 2009

    I'm using getTickCount() before and after the <cfhttp> tag to get the time elapsed

    Inspiring
    October 19, 2009

    Is it any <cfhttp> call that's doing this, or a specific one?  Well: I mean any <cfhttp> call that takes longer than 2sec, obviously ;-)

    Can you post some code to replicate this (with a real URL for the <cfhttp> call).

    I'm not sure I can get CF5 running on my machine, but I'll give it a whirl.  I think I have a CF5 installer lying around somewhere..?

    --

    Adam

    BKBK
    Community Expert
    Community Expert
    October 18, 2009

    My interpretation is that cfhttp's timeout is the time Coldfusion waits for a response to the cfhttp request. After the timeout, it considers the request to have failed.

    Therefore, a cfhttp response might come in within 2 seconds, but Coldfusion could take more seconds to process the rest of the page. Why don't you use <cfsetting RequestTimeout = "2"> to set a timeout for the cfm page?

    October 18, 2009

    we'r eon CF 5, which doesn't support <cfsetting RequestTimeout = "2">

    BKBK
    Community Expert
    Community Expert
    October 18, 2009

    Sorry, I didn't know that. May you put requestTimeOut=2 in the URL?