• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

LEGEND ,
Jul 31, 2008 Jul 31, 2008

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

364

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 31, 2008 Jul 31, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 31, 2008 Jul 31, 2008

Copy link to clipboard

Copied

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


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 31, 2008 Jul 31, 2008

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation