Skip to main content
Inspiring
April 27, 2012
Answered

3 log entries per cfhttp or cffile request?

  • April 27, 2012
  • 2 replies
  • 993 views

Hi People,

We are running CF9 or Windows 2008 server.  While troubleshooting a server load issue we found in the IIS logs that there are 3 entries for each CFFILE or CFHTTP request. We are not sure if that is normal or if it represents some mis-configuration.  Here is a sample of the IIS log entries. 

2012-04-26 19:10:58 172.31.192.66 GET /IMAGES/0016.jpg - 80 - 76.76.239.65 Java/1.6.0_17 200 0 0 78

2012-04-26 19:10:58 172.31.192.66 GET /IMAGES/0016.jpg - 80 - 76.76.239.65 Java/1.6.0_17 200 0 0 46

2012-04-26 19:10:58 172.31.192.66 GET /IMAGES/0016.jpg - 80 - 76.76.239.65 Java/1.6.0_17 200 0 0 31

Normal HTTP requests, such as an IMG tag in a web page, only generate one record in the logs. There is some concern that these multiple requests might be partially responsible for the server load.

Any help would be appreciated. Thank you very much,

David McCan

This topic has been closed for replies.
Correct answer PapaMech

Thanks Adam for the suggestion and thanks Charlie Arehart for helping to troubleshoot.  Confirmed using wireshark that ColdFusion pulls the remote image once when using CFIMAGE read or the IMAGENEW function and then an additional 2 more times when using CFIMAGE write or the IMAGEWRITE function.  Logged as ColdFusion 9.0.1 bug 3178478. 

CFHTTP only pulled the image once.  So the workaround is to pull the remote image via CFHTTP and then create an image object along these lines:

<cfhttp url="#imageLocation#" getasbinary="yes">

<cfset objImage = imageNew(cfhttp.filecontent)>

David

2 replies

PapaMechAuthorCorrect answer
Inspiring
April 30, 2012

Thanks Adam for the suggestion and thanks Charlie Arehart for helping to troubleshoot.  Confirmed using wireshark that ColdFusion pulls the remote image once when using CFIMAGE read or the IMAGENEW function and then an additional 2 more times when using CFIMAGE write or the IMAGEWRITE function.  Logged as ColdFusion 9.0.1 bug 3178478. 

CFHTTP only pulled the image once.  So the workaround is to pull the remote image via CFHTTP and then create an image object along these lines:

<cfhttp url="#imageLocation#" getasbinary="yes">

<cfset objImage = imageNew(cfhttp.filecontent)>

David

PapaMechAuthor
Inspiring
April 27, 2012

Byte logging was turned on for the IIS log and it appears that the image is fetched three times for each cfhttp and cfimage request.  This seems very odd.  Does anyone have any insight on this?

Thanks

Inspiring
April 27, 2012

So if you have a file with a single <cfhttp> call in it, and nothing else, and run that: you see three entries in the IIS log?

And ditto with a single <cfimage> call?

--

Adam