Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About sessions time out

Status
Not open for further replies.

bomayed

Technical User
May 13, 2002
101
0
0
AE
How do I tell ASP to execute a SELECT statement only once a month and keep the results presented to the visitors until the end of the month?

I don't want each user to execute this select statement because he/she will get the same exact information like the rest of the visitors for the whole month so why execute it again and again :)

Can someone help me out , give me a hint or something

Thank you




 
create a cron job and set it to run once a month, then create a page on the fly with the new data(or store it in a special db table or whatever)


Bastien

Cat, the other other white meat
 
add a small table with event history into your primary web application database, that has job name and last run in it

then in the page that this is firing off put in a conditional based off the last date ran in the DB for this job name, if the date comes up as a winner, then output your results to an include file ( via FSO ) that wont be changed until the next time the schedule is due to fire again, and just include the include file
 
Or without event history table in DB:

- if file doesn't exist, create it
- if file has "Last Modified" older than 1 month, create it
- include file via FSO

This technique (with or without DB, whatever) is also known as "page fragment caching".
 
side note on top of that.. as for options, main reason i use(d) DB based values is it's much easier to change teh DB date and force a refresh than a last modified date on a file.

hope the info helps, and best of luck in your project
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top