That really helped, I didn't think about generating the file that way.  I
have done other things like that, but sometimes it just helps when you get
another set of eyes on the project at hand.  Thanks for the refresher.

Josh

-----Original Message-----
From: - Edwin - [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 11:56 AM
To: Joshua Minnie
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] cache control with javascript



On 2003.10.21, at 22:28 Asia/Tokyo, Joshua Minnie wrote:

> The "it" that you were asking about was the server.  The javascript
> file is
> actually a PHP file that produces the JavaScript that I need.  I only
> have
> one access to a database and a while loop to generate the code.  Here
> is the
> code pieces:

...[snipped_code]...

> The customer database can get potentially large so that this file
> could take
> a while to generate.  Currently there are only 300 records but I
> anticipate
> many more.  Does anyone have any recommendations that might speed this
> up?

Hmm... I think you missed the point earlier.

Here's the basic idea. Create/generate a separate file ("whatever.js")
[1] and make sure that this file is ONLY *updated* when necessary (e.g.
updated database)[2]. Call this file inside your HTML <head> tags. [3]
This way, the "whatever.js" will be "cached" whenever possible.

- E -

[1] Check the file functions in the manual (if you're not familiar with
it already).
     (http://www.php.net/manual/en/ref.filesystem.php)
[2] Tip: Have a separate php script that generates the "whatever.js".
     Use/run this script ONLY after you made an update to your database.
[3] Something like this:
   <head>
     <script src="/path/to/whatever.js" language="javascript"
type="text/javascript"></script>
   </head>

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to