So currently I have a small web application that loads, processes, and displays a very large xml file (in excess of two megabytes). Unfortunately, especially along with the post-processing that takes place, the request takes around 6-7 seconds to load. Is there any way to speed up the loading of the xml file? The simplest way I can think of would be to load the XML file once into memory and then access that memory each request, but I'm not sure how to do that in PHP. From what I understand about the technology, using FastCGI should work, but again I'm unaware about how to go about constructing the necessary infrastructure to make it work.
So, I guess, what would everyone recommend to speed up the site? I'm, unfortunately, wedded to the idea of XML files at this point, and the transition to databases would be quite ugly (it's very tree based). But anything people could recommend will help.