zeeg
03-22-2005, 01:28 AM
I'm currently working on changing my method of caching, as it's getting to strenious generating pages in advance.
My idea is to run it through mod_rewrite, have a script check if its outdated, and then generate if needed, if not, simply include the file for display.
Here's an example
1) User loads /content/page-id02.
2) That page runs back through /cache.php.
3) It rips out "02" and finds /cache/02.html.
4) If /cache/02.html is older then say.. 6 hours.. it does a db query, to check if a variable stored in 02.html (timestamp), is older then the newest version of one stored in the db.
5) If needed, generates the page
6) Does a simple php include on the cached page.
My needs for something like this are:
1) we have a LOT of data
2) we want the site to load as fast as possible
3) the data changes a LOT (this is why id prefer on demand rather then pre-cached)
4) we dont want a lot of load on the server
I'm wondering if anyone has any suggestions about my idea to do this, or if someone knows of a better way that they have done themselves?
My idea is to run it through mod_rewrite, have a script check if its outdated, and then generate if needed, if not, simply include the file for display.
Here's an example
1) User loads /content/page-id02.
2) That page runs back through /cache.php.
3) It rips out "02" and finds /cache/02.html.
4) If /cache/02.html is older then say.. 6 hours.. it does a db query, to check if a variable stored in 02.html (timestamp), is older then the newest version of one stored in the db.
5) If needed, generates the page
6) Does a simple php include on the cached page.
My needs for something like this are:
1) we have a LOT of data
2) we want the site to load as fast as possible
3) the data changes a LOT (this is why id prefer on demand rather then pre-cached)
4) we dont want a lot of load on the server
I'm wondering if anyone has any suggestions about my idea to do this, or if someone knows of a better way that they have done themselves?
