Skip to main content
Inspiring
July 31, 2008
Question

What is the best way to auto-generate pages at an interval?

  • July 31, 2008
  • 3 replies
  • 414 views
In order to minimize the server's workload we're exploring ways of auto-
generating pages that have dynamic content throughout our website.

I know we could use CFSCHEDULE and have it make an HTTPRequest as its
operation to read the dynamic page then use output to write the resultant
page. However, if an error occurs during the request, the result is can be a
blank file.

So would it be a better approach to use CFSCHEDULE to run a page that would
have the error checking using CFTRY and CFCatch, and as a result, have a
go/no-go in terms of overwriting the previous successful version of the file
via cffile?

Does anyone have an example of such a system that would keep me from re-
inventing the wheel?

Thanks for your help,

Michael Brown
Webmaster
Texas Department on Aging and Disability Services
This topic has been closed for replies.

3 replies

Participating Frequently
August 1, 2008
Probably a stupid question, but why not just use <cfcache>?
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_c_01.html#1097532
BKBK
Community Expert
Community Expert
August 1, 2008
Does anyone have an example of such a system that would keep me from re-inventing the wheel?

I haven't. But I think your description suggests straightforward coding:
1) use cffile to read the text of the dynamically generated cfm page (dgp.cfm, say);
2) store text in database;
3) modify the content of dgp.cfm;
4) use cffile to write the new content to dgp.cfm.

Use a try-catch in each step. The process wont reach the crucial 4th step if an exception occurs in an earlier step.




edited: reversed order steps 1 and 2


August 1, 2008
Michael,

i have a "refresh" page for monitoring updates on a client site... the only issue is that this page must be kept open but it does goes thru numerous data sources and updates any pages as needed.

nice thing is that you can keep a running track of generated content (with links) and check for errors, etc...

basically page has line

<META HTTP-EQUIV="REFRESH" CONTENT="900;URL=home.cfm?pdg=1&pdgg=1&pncom=1&dtst=1">

the 900 is seconds (15min) and it just calls itself each time. page has all functions and reporting written in

maybe will work your requirements. rest is just tags to trigger queries, etc and keep out the nosy.