Skip navigation
Currently Being Moderated

How to enable persistent connection with ColdFusion8 and IIS6

May 15, 2012 6:50 AM

Tags: #iis #coldfusion8 #coldfusion #persistent #keepalive

Hello,

 

I'm trying to use HTTP persistent connection (Connection: keepalive) with coldfusion dynamic content.

Actually, persistent connection already works fine with static content handle by IIS6.

 

Is there a way to enable it (using chunked encoding I think, or waiting the end of cfm execution to get the content length)

 

I'm looking for a solution on the "server configuration" side. I know I can deal manually with the content-length header on my cfm, but I'm looking for a larger solution.

 

Is anyone know a way to achieve it ?

 

For information, I'm using ColdFusion 8 Entreprise, IIS6 with Windows 2003 R2 32 bits.

 

Regards,

 

--

Erwan

 
Replies
  • Currently Being Moderated
    May 15, 2012 12:46 PM   in reply to erloz

    What is your real goal? What is it about the default configuration that does not suffice for your needs? Just trying to understand what the motivation is, before showing how to dig into nuts and bolts, since it’s not something that’s asked about often, at all (in my experience).

     

    /charlie

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 12:15 AM   in reply to erloz

    I've gotta concede I knew nothing about this before starting to google about it just now, so I'm not going to be any help here.  You're talking about this - http://en.wikipedia.org/wiki/HTTP_persistent_connection - right?

     

    It looks to me like this is entirely down to the web server sending a keep-alive to the browser (HTTP 1.0), or it just happens as a matter of course (HTTP 1.1), and whether CF is involved in the mix is neither here nor there.  Or should be neither here nor there.  CF doesn't participate in the HTTP connection, so it oughtn't have any impact on matters.

     

    Looking at my IIS config, one can either have keep alive switched on or off, and that's it.  There's no suggestion that it's done for specific MIME types (not that a CFM-fulfilled request is intrinsically a different MIME type, but I could see how the different file extension could potentially confuse matters, if things weren't done in a sensible fashion), or any other configuration options at all.

     

    Also, I can't see how - logically / sensibly - a keep-alive (working at TCP level) would be impacted by the kind of documents being sent over said connection.  They're two completely different layers of the... ooh, I don't want to date myself by saying it, but... OSI model.

     

    FWIW, all my CF requests have a "connection: keep-live" header sent, even though I'm using HTTP/1.0.  This is on IIS 6, but using CF9.


    What are you looking at that determines that the connection isn't being maintained?  I'm not doubting what you said, but you've piqued my interest now, so want to have a look at it.

     

    --
    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 6:13 AM   in reply to erloz

    Gotcha.  OK, more googling seems to have clarified the dynamic quandrary for me.  I found this which seemed relevant: http://docstore.mik.ua/orelly/java-ent/servlet/ch05_03.htm

     

    I dunno if this will work, but in your onRequestEnd() after you've finished composing the page, you can get a len() on the output buffer... len(getPageContext().getOut().getString()), and set your content length with that, then let CF flush everything as per usual.

     

    As for which headers I was looking at, you're dead right I was looking at the request ones, not the response ones (duh).  Oops.  And I was seeing the same thing you were for the response headers.  However if I specified the content-length, the "closed" went away.

     

    I dunno if this is any help... like I said, I'm just googling stuff up and trying it.  mayeb some of it is wheat rather than chaff ;-)

     

    --

    Adam

     

    PS: Why is it that depsite clearly signing everything I ever post as "Adam", people often tend to see my full name in the heading of the post and decide to call me "Cameron"?  Not that it matters, but it intrigues me.

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 8:00 AM   in reply to erloz

    I don't know that you can't, but I am @ work (although one would be forgiven for thinking I was just sitting here all day), and was between meetings so posted my intermediary findings as soon as I found 'em.  I hasten to add I don't actually "know" any of this stuff, I'm just googling it and experimenting as I go.

     

    --

    Adam

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points