Top DevX Stories
Location-Aware App Review
The Future of Web Content -- HTML5, Flash, and Mobile Apps
Moonlight 3.0 Preview Offered For Rich Internet Apps on Linux and Unix
Why a Moderator is Key in the Engineering Review Process, Part II
Windows 7 Features Your Clients Will Need on Day One
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > Web

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 05-15-2000, 12:58 PM
Joshua Anderson
Guest
 
Posts: n/a
Best way to cache data on web server??


Here is my problem...
I have about 9 tables that are pretty much static and i would like to cache
them somewhere, somehow on the server. If i don't do that, everytime a new
user registers i build combo/select/dropdown (whatever you want to call them)
based on these 9 tables so that the user may make a choice. Now that consists
of 9 separate hits on the DB. What is the best way to cache the data and
store it on the server so that the boxes are created from this source instead
of the DB? Naturally i plan to update these table at some predetermined
interval, and allow administrators to do so manually if they add a row to
a table and they know they need to refresh the cache.
Reply With Quote
  #2  
Old 05-16-2000, 01:50 PM
Kimoanh T. Vo
Guest
 
Posts: n/a
Re: Best way to cache data on web server??


Joshua,

1. Write code to output the selected name/value pairs from those 9 tables
into a static file, namely "lookup.js" which resides on the server, with
some
contents as follows:

var sLkup = new Array();
sLkup[0] = new Array();
sLkup[0][0] = "";
sLkup[0][1] = "";
sLkup[1] = new Array();
sLkup[1][0] = "00";
sLkup[1][1] = "International";
sLkup[2] = new Array();
sLkup[2][0] = "AL";
sLkup[2][1] = "Alabama";
sLkup[3] = new Array();
sLkup[3][0] = "AK";
sLkup[3][1] = "Alaska";
.........

2. In the form which has the dropdown list, include the above static file:

<script language = "JavaScript" src = "lookup.js">
</script>
.........

' Write client-side script to generate the dropdown list as follows:
<select name = "state" size = 1>
<script language = "JavaScript">
for( kk = 0; kk < sLkup.length; kk++ )
{
document.write( "<option value = \"" + sLkup[kk][0] + "\">" +
sLkup[kk][1] + "\n" );
}
</script>
</select>

3. Whenever one of those 9 tables is updated, the first step is executed
to refresh the contents of "lookup.js" file again.

Is this what you're looking for ? Hope this helps.

kv-



"Joshua Anderson" <janderson@lottery.com> wrote:
>
>Here is my problem...
>I have about 9 tables that are pretty much static and i would like to cache
>them somewhere, somehow on the server. If i don't do that, everytime a

new
>user registers i build combo/select/dropdown (whatever you want to call

them)
>based on these 9 tables so that the user may make a choice. Now that consists
>of 9 separate hits on the DB. What is the best way to cache the data and
>store it on the server so that the boxes are created from this source instead
>of the DB? Naturally i plan to update these table at some predetermined
>interval, and allow administrators to do so manually if they add a row to
>a table and they know they need to refresh the cache.


Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:37 AM.


Sponsored Links



Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.