We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Is it possible for a coldfusion page to launch another template, but not in the user's browser

bigmikey88
bigmikey88 asked
on
Medium Priority
254 Views
Last Modified: 2012-05-11
I have a test/quiz built in ColdFusion 9, and when the user hits the last page, I would like that to trigger a page that actually does the scoring and writing the report.

But I don't want the user to see any of that.

Also, in case the user closes their browser or moves to another page after they hit the last test page, I don't want that to interrupt the scoring and report writing which can take a few seconds.

So the scoring and reporting can't be running on the users browser.  Needs to be running in something like a browser opened by the system.

Currently I run the scoring and report writing as a scheduled task that runs every 2 minutes.  I'd like to get rid of the scheduled task because it runs whether or not there are any tests to process.

Another reason to get rid of the scheduled task is that even the 2 minute delay in getting test results can upset the customers who paid a premium to get their results immediately.  Other customers pay a budget price and get their reports on the next day.


Any suggestions?
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi gdemaria,

thx for fast response

The reason I don't want to show users that something is processing, is for marketing / commercial reasons.  Certain people will pay a higher price and others prefer to get the lowest price even if they have to wait a day  for their results.  

This lets us offer a budget price and then a premium price with the only difference being the delivery time.

It was a way to offer the customer a choice.  Sort of like when you go to Sears and see 3 choices - good, better, best.

So how can I start a separate thread?

 
CERTIFIED EXPERT

Commented:

For the sake of discussion, let's say the processing takes 2 minutes.

The challenge is that once the user is done with the test, there is 2 minutes before the results can be shown.  So what do you do with the user for those two minutes and how do you let the user know what the time is up and the report is ready?

If you start a seperate thread, you can allow the user to browse through the pages on the website, but wouldn't the user still know that he/she doesn't have the report yet?  Isn't he/she waiting for the report at this time?   What can you have the user do while waiting those two minutes, whether you start a new thread and allow them to browse around (for no reason) or you show a processing statement... is there really a difference?    

It seems to me, without knowing a bunch about your app, that a 2 minute wait is "immediate" and worth spending more money over a 24 hour turn around time..  It doesn't seem it has to be 5 seconds to be worth the extra money as 2 minutes is much faster than 24 hours..


Speaking of which, did you really try tuning this app?   I have a processing program that generates 3-5,000 records and loops through most of them while processing.  It used to take 3-5 minutes, now, after I tuned it, it takes 20 seconds.    

CERTIFIED EXPERT

Commented:
<cfthread> is the command to start a new thread, I just don't know if it will get you anywhere because the user has nothing else to do, except wait for the results, true or not?

Author

Commented:
The app I've been running gives the user a page which tell them when to come back for their test results.

It also suggests some other things they can do on the site.


I will have to think about what you have said.  I might just be stuck in an old way of thinking.

I am tuning / rewriting the entire app right now.  It is possible I can make it fast enough to just tack it on to the end of the test.
CERTIFIED EXPERT

Commented:

> The app I've been running gives the user a page which tell them when to come back for their test results.

I understand that if they are the higher paying subscriber, that you don't want them to have to come back for the results.   My suggestion to resolve this is to (1) tune the app so it runs faster and (2) to show them a processing page (just like all the major travel sites) and let them know that their results will be "immediate", while you wait... so they have to wait a minute for it, it's better than coming back the next day...

If a bunch of your code is SQL statements, you can very well improve the speed by adding indexes.  I put a time stamp before every segment of my code (ie.  "Now adding section I results..."  with date/time)    I looked at the SQL that took the longest and added indexes to make it run faster.   It really really helped.

Author

Commented:
good idea

let me get back to you on that

Author

Commented:
OK

I've decided to try the approach you suggest.

I've done a new flow chart for this new process and it makes sense.

Thanks for your insight.

Michael

Author

Commented:
great advice

thx
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.