Hey,
I'm kinda new to PHP so I'm not even sure it's the right tool for the job but here goes:
I have a few reference documents that are used throughout my site. They are fairly large XML & XSLT documents that need to be used quite often by multiple php and javascript functions. How do I store these documents in the server memory so that they don't need to be reloaded each time a function uses them?
The way I'm doing it now is sending a GET HTTP header to give me the file and then using DOM to parse it and get my info - kindof AJAX-like. But the GET is slow and I want to avoid it.
Any ideas? Am i going about this the wrong way? Can PHP solve my problems?
Thanks so much!
Accessing XML documents in the server from a PHP script
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
PHP can handle XML parsing fairly effectively and efficiently if done right. There are some native XML functions to PHP, but most fokls use them to make their own XML readers. In fact, I have just taken a script I found on a tutorial at Sitepoint and used that as a basis for a multi-input XML/RSS reader. So yeah, PHP can do it and it can do it well if done right.
-
jamiel
- Forum Contributor
- Posts: 276
- Joined: Wed Feb 22, 2006 5:17 am
- Location: London, United Kingdom
Look at memcache and the PHP Memcache functions : http://php.net/memcacheHow do I store these documents in the server memory so that they don't need to be reloaded each time a function uses them?