List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:May 8 1999 7:16pm
Subject:Re: Generating Static Files
View as plain text  
Richard McLean wrote:
> 
> Hi All,
> 
> I have a site which is using MySQL & PHP to dynamically insert database
> information into pages and was wondering if anyone knows of a solution
> available for generating static files with the information instead.
> 
> The information isn't changing as much as we thought that it would, and I
> would like to get around the added overhead of it being dynamic.
> 
> I know that this probably isn't that difficult to do, but it is outside of
> my level of knowledge with either PHP or Perl right now.
> 
> Anyone know of an already built server-side solution to do this (free or
> commercial)?
> 
> kind regards,
> Richard McLean
> 

Well, I am not exactly sure what exactly you are trying to accomplish,
but if it querying static data with a reasonably limited set of queries,
you can write a little hack that does not take a database genuis. Here
is the outline:

- Pick a set of most popular queries
- Create a table similar to this : query_cache ( query char(2000) not
null primary key, encoded_result blob)
- Come up with some convention to delimit fields and rows in the result.
For example you could use \000 to delimit fields,  \n to delimit rows,
and \ as an escape character.
- Once a day(week,month,year?) run the most popular queries, and cache
the results
- When the user comes to your site, instead of querying the big
database, query the cache.

-- 
Sasha Pachev
http://www.sashanet.com
Thread
Generating Static FilesRichard McLean8 May
  • Re: [PHP3] Generating Static FilesChad Cunningham8 May
  • Re: Generating Static FilesSasha Pachev8 May
  • Generating Static Filesterry jones9 May