Kevin Wang wrote: >Hi All, > >My php5 web application needs to parse/marshall a bunch of large xml files into >php5 objects at the beginning of handling each request. These xml files are >static across all the requests and it is really time consuming to >parse/marshall them into php5 objects. > >I am wondering if there is any means to cache these xml objects so that each >request will not go through the same time consuming xml parsing/building >operation. Serialization doesn't work in my case as deserialization is also >very expensive. > >I am using Apache as the web server. What I am thinking is that if php5 allows >us to keep certain objects (and their references) around across all the >requests in a child process instead of cleaning all the object memory every >time after a script/request is finished. > >I guess this problem is quite common for any large and complicated php >applications. > > If I had XML files that large, I would either switch database engine to MySQL or PostgreSQL since that way I can page/load the data quicker than parsing an XML document, or, I would consider the following: Does the XML data change a lot? If not, why not cache the actual HTML output instead of the data? That way you get n number of HTML documents instead of one dynamic script, these files would only change when the XML file has a changed filemtime(), and, it's easier for the server to handle the requests. Take a look at: http://pear.php.net/manual/en/package.caching.cache-lite.php Cache_Lite is actually quite powerful since it allows you to cache either the entire finished output, or just a part of the site and render that from cache until the data has changed. You could write down a whole series of cached documents either from one request, or by running a cron under Linux or scheduler task under Windows, and one user wouldn't get the brute of the waiting time when it renders the cached parts. Just some ideas... I hope I helped somehow. Warm Regards, Torgny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php