开发者

simplexml cache file

开发者 https://www.devze.com 2023-04-07 15:13 出处:网络
I am loading an XML file which is pretty heavy and contains a lot of data, and I am only using a small amount of it. This is causing my site to take ages to load.

I am loading an XML file which is pretty heavy and contains a lot of data, and I am only using a small amount of it. This is causing my site to take ages to load.

http://www.footballadvisor.net/

Can anyone advice me on a resolution to this, is there a way in si开发者_JS百科mplexml that I can cache the file for a period of time? My site is in PHP.

Thanks in advance

Richard


You wouldn't do it directly with simplexml. What you'd need to use is the other file functions (fopen or file_get_contents), save the file or extract the bits you need and save it. If enough time has passed since the last time it was checked (or if enough time passed that new data would be available) you could delete the cached data and check again.

0

精彩评论

暂无评论...
验证码 换一张
取 消