September 07, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
problems with cflocation and redirect will never complete
Hi,Casey Dougall 04/25/08 02:18 P Casey,Marco Antonio C. Santos 04/25/08 03:48 P On Fri, Apr 25, 2008 at 3:47 PM, Marco Antonio C. Santos <Casey Dougall 04/25/08 03:59 P Casey Dougall wrote:Ian Skinner 04/25/08 04:04 P On Fri, Apr 25, 2008 at 4:03 PM, Ian Skinner <HOF@ilsweb.com> wrote:Casey Dougall 04/25/08 04:16 P Casey Dougall wrote:Ian Skinner 04/25/08 04:32 P Ian Skinner wrote:Ian Skinner 04/25/08 04:35 P Cfhttp to the rescue ;)Dominic Watson 04/25/08 04:33 P @ CaseyGerald Guido 04/25/08 04:52 P >@DomDominic Watson 04/25/08 05:01 P I'll try this some more in the morning...Casey Dougall 04/25/08 06:25 P > I'm having troubles with a cflocation script.Dave Watts 04/25/08 07:29 P Hi, I'm having troubles with a cflocation script. First Script finds the ID that it needs and then should perform a <cflocation> the the script that runs a process that generates an xml file. At that end of that script, it should do another cflocation back to the original script and find the next ID that needs and run through this process all over again. When I try running this in the browser, firefox returns the following. Firefox has detected that the server is redirecting the request for this address in a way that will never complete. I'm trying to select 1 ID at a time, run the process, then <cflocation> back to the original script and run again until it's finished but it only goes through 5 to 10 id's before I hit this error. Coldfusion Scheduled task didn't complete this as I had hoped either. Any ideas of how I can get around this issue. If you need to generate an XML file for 1000 ID's each may end up being 1 to 2 meg in size. This was the best way I could figure to get around script timeouts. Now I get "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." -- Casey Casey, my suggestion is to change your cflocation with Java redirect routine. Please try this: <cfscript> getPageContext().getResponse().sendRedirect(local.YourURL); </cfscript> Cheers Marco Antonio On Fri, Apr 25, 2008 at 3:17 PM, Casey Dougall < casey@uberwebsitesolutions.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- On Fri, Apr 25, 2008 at 3:47 PM, Marco Antonio C. Santos < marcoacsantos@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Still no luck... It runs for about the same amount of time and then thinks it's in an infinite loop and quits. This is also a BlueDragon .Net Server. I haven't had a project on one of those before. Maybe there is another way to get around due to this... Casey Dougall wrote: > Any ideas of how I can get around this issue. If you need to generate an XML > file for 1000 ID's each may end up being 1 to 2 meg in size. This was the > best way I could figure to get around script timeouts. > What about resetting the script timeouts to a value large enough to accomplish your task either globally in the administrator or locally with the <cfsetting...> tag? > Now I get "Firefox > has detected that the server is redirecting the request for this address in > a way that will never complete." Well, from Firefox's point of view that is exactly what you are doing. It can't see what the server is doing and understand that it is involved in an iterative loop that will eventually end. It can only see that is is getting the same sequence of 301 redirects over and over. The developers of browsers have intelligently made them so that they do not get trapped in an endless loop like this. On Fri, Apr 25, 2008 at 4:03 PM, Ian Skinner <HOF@ilsweb.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Right, so i tried appending a URL variable to the end that changes everytime the script runs, but that didn't work either. Casey Dougall wrote: > > Right, so i tried appending a URL variable to the end that changes everytime > the script runs, but that didn't work either. Well a different query, AKA url, variable does not change the resource redirected to. If this where to work you would somehow have to change the base path somehow. Probably using some type of "Search Safe" URL scheme. But my gut tells me that tricking the browser to make 1000 requests|redirects is the best way to resolve this requirement. Ian Skinner wrote: > But my gut tells me that tricking the browser to make 1000 > requests|redirects is the best way to resolve this requirement. ... is **NOT** the best way to resolve this ... Cfhttp to the rescue ;) <cfloop query="theIds"> <cfhttp url="addressthatProcessesTheId" method="get"> <cfhttpparam type="url" name="theId" value="#theId#" /> </cfhttp> </cfloop> HTH Dominic ----- Excess quoted text cut - see Original Post for more ----- @ Casey You said that it was a problem with Time outs? You can override the servers default time out using cfsetting. ex: <cfsetting requestTimeOut = "5000"> If that doesn't solve the problem Dom's idea looks good. @Dom Stop making sense. ;) HTH, G On Fri, Apr 25, 2008 at 4:32 PM, Dominic Watson < watson.dominic@googlemail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- >@Dom > > Stop making sense. ;) Once it was better than chocolate and then I thought no I want to select more than one at a time how can I do that please :p How's that? Back to sense and using cfhttp, you will more than likely still need to set an extended timeout to stop the request timing out (@Gerald, I think the original problem was that the original request was maxing out memory because of huge amounts of Xml strings): <cfsetting requesttimeout="#appropriateTimeout#" /> <cfloop query="theIds"> <cfhttp url="addressthatProcessesTheId" method="get"> <cfhttpparam type="url" name="theId" value="#theId#" /> </cfhttp> </cfloop> Anyways, Domininc -- Blog it up: http://fusion.dominicwatson.co.uk I'll try this some more in the morning... Thanks Casey ----- Excess quoted text cut - see Original Post for more ----- Why not do this asynchronously? Redirecting the browser a thousand times strikes me as a bad idea even if it did work. But if you do need a synchronous solution in CF, why not use a META refresh? <meta http-equiv="refresh" content="5;url=http://yourserver.com/yourfile?id=#whatever#"/> Processing #whatever# of #total# ... Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||