![]() |
Caching question
Is it possible to create a caching script that can cache pages that are dynamicly created?
For eg, If each page in a certain section is created by a variable in the url: mysite.com/games?=game_id Where game_id tells the script what to fetch from the DB for that page. I don't nesc need to know how to do it, just if it is possible and on what scale of the difficulty meter it would sit on. I need to factor it into what platform I am going to use for my next site. (I guess it must be possible as vB can cache posts/threads?) Cheers, |
Yes it's possible to cache based on the request url, and it's a fairly simple task to achieve.
|
Ah right thanks Salathe.
Just out of interest what would be involved? (roughly) Thanks! |
There are two things involved mainly. Firstly, grabbing the page's uri which you might use
$_SERVER['REQUEST_URI'] as a starting point. Secondly, to grab the page's finished HTML you would want to use output buffering with a callback function/method to save a cache file.Of course, things can be made much more complex if you wish or if your requirements dictate it. |
Ah k thanks.
That makes me feel better as one of the main reasons I was going to go with Drupal was because of page caching.. but if I can get page caching built in at a later date on more of a custom route that's good news. |
An easy route to "cache" a page would be to use a PHP module such as eAccelerator which caches the page and updates it on change.
|
or u can use PEARs cache_lite PEAR :: Package :: Cache_Lite
|
| All times are GMT. The time now is 01:58 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0