English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Here's the deal... we have a HUGE database of items (over 200K) that are displayed maybe 10 at a time. What I want is the FIRST time (in a 24 hour period) that someone goes to a particular page (say.. www.somesite.com/catalog/shirts_page_1.php), it should hit the database for the results and save it on the machine as a formatted HTML file. Then the next time that anyone goes to that page (within 24 hours), it simply loads the static HTML page instead of re-querying the database.
I know there are "Template Engines" out there like Smarty that do something SIMILAR, but not exactly. Please advise if you've heard of anything like this.

Thank you.

2007-04-11 02:43:54 · 4 answers · asked by Honamos 2 in Computers & Internet Programming & Design

4 answers

ASP.NET this is referred to as caching. There are two main types of caching in ASP.NET.

OutputCaching, caches the output of the page, that is the html to be rendered to the client in server memory. You can specify a duration to cache your page.

The Cache API provides somehow a similar functionality and also provides dependencies on which your data relies on to consider the cached Data as valid or not valid. You can stored any type of object in the Cache API.

2007-04-12 22:30:39 · answer #1 · answered by Anonymous · 0 0

Some simple php could check the timestamp of a static page, if it is > 24hrs old, then regen the page and display. If < 24hrs old, just display the existing page.

Alternatively, you could just gen the static html using cron or other time based tool and then just always have the webserver show the static content. This saves the first person hitting the page from having to wait for the content to be generated.

2007-04-11 09:50:32 · answer #2 · answered by rltm_9999 5 · 0 0

well you didn't specify what technology you're using.

In ASP.NET this is referred to as caching. There are two main types of caching in ASP.NET.

OutputCaching, caches the output of the page, that is the html to be rendered to the client in server memory. You can specify a duration to cache your page.

The Cache API provides somehow a similar functionality and also provides dependencies on which your data relies on to consider the cached Data as valid or not valid. You can stored any type of object in the Cache API.

Caching in server memory is quite much faster than saving the html to be served on disk.

Hope this helps

2007-04-11 11:45:57 · answer #3 · answered by Smutty 6 · 0 0

You already have the answer to this.
Optimise your database and concentrate on indexes and program access commands.

2007-04-11 10:22:49 · answer #4 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers