Question

I have written simple rewrite rules that rewrite .cfm extension links (using outbound rules), and resolve to the full .cfm path with an equivalent inbound rule. Example:

This outbound link:

http://mysite/section/page

Resolves to this full path:

http://mysite/section/page.cfm

When I visit a link without the file extension, in any browser, the page displays on the screen but the browser still seems to 'wait' for the page to finish loading (get that spinning circle in the browser tab, while Firefox says "transferring data from mywebsite...")

After about 5 minutes of 'waiting' for the page to load, the browser will stop trying to load and displays 'cannot display the page' error. I used Firebug's NET panel to see whats going on and basically the page never finishes loading (the size of the file remains 0kb until the browser falls over).

If I go to a fully qualified path page e.g. http://mysite/section/page.cfm then the page loads completely within about 20ms and Firebug gives me the size of the page.

Can anyone please suggest whats going on and how to fix it?

Was it helpful?

Solution

OK I have somewhat solved it, or actually solved it.

Its a ColdFusion issue. If anyone else if facing this here is what you do:

  1. Create an Application.cfc page.
  2. Add this function to your component:
<cffunction name="onRequestEnd">
    <cfheader name="Content-Length" value="#Len(getPageContext().getOut().getString())#" />
    <cfset getPageContext().flush()>
</cffunction>


So what is happening here is that we are setting the Content-Length header to a correct size because ColdFusion messes it up if you let it do it itself. The cure to ending the never-ending page load is to put the getPageContext().flush() after setting the Content-Length so that the browser gets all the page content.

Frankly I made it work with some Google searching and random hacking. It may not be the correct way to address the problem (because in Firebug it says there is a 500 error going on) but it seems to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top