You are here: Re: [PHP] caching parsed XML files... FALSE advice, still not working « PHP « IT news, forums, messages
Re: [PHP] caching parsed XML files... FALSE advice, still not working

Posted by Petr Smith on 10/28/82 11:28

Petr Smith wrote:
> Jasper Bryant-Greene wrote:
>
>> Petr Smith wrote:
>>
>>> is it possible to cache parsed XML files somehow? I'm writing
>>> template library based on XML. But it's not very efficient to create
>>> new DomDocument, load XML template, process it and show on every page
>>> hit. XML parsing is not very fast, and because I'm parsing XHTML with
>>> entities, all DTD's are parsed too. I thought about something similar
>>> to java - there I can have servlet which lives all the time the
>>> server lives. It can load XML and parse it only for the first time
>>> and send DOM objects to another servlets.
>>> I need something similar with PHP, can it be done?
>>
>>
>>
>> This question seems to come up every other week on this list. Have a
>> look at APC[1]; you can cache objects with its apc_store() and
>> apc_fetch() functions.
>>
>> [1] http://php.net/apc
>
>
> Thanks, looks usable.. I hope it can synchronize successfully between
> different calls on heave load. I'll try it, I don't know why I missed it
> when browsing documentation.
>
> Petr

Hi,

it's not working at all. And it could never work. I don't think it's
funny to write false advices to people "every other week".
I've installed APC cache, tried to save XML. It was not working.
apc_fetch returned NULL every time.

$dom = apc_fetch("dom");
if ($dom === false) {
$dom = new DomDocument();
$dom->load("browsers.html");
$store = apc_store("dom", $dom);
echo "store finished: $store";
}
echo $dom->saveXML();

When I looked into documentation for APC - there is this sentence: "And
apc_store() currently doesn't work at all for (internal) classes in PHP5
right now.". And all the XML stuff is what? Internal PHP5 classes!

Please don't confuse people with false edvices next time. Better to say
nothing then solutions that are not working. I lost lot of time and got
only ton of disapointment.

And still no solution to my problem :(.

Petr

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация