dom - PHP memcache internal objects -
i have googling while , found nothing.
when dealing internal objects such dom or pdo, possible cache them using memcache?
i understand pdo irrelevant because connection closed @ end of script - changed persistent connections -- making caching more feasible???
whats bothering me though, lack of documentation on whether possible cache in-memory representation of dom objects. xml config files quite verbose , loading these per request, constructing dom, way heavily on server resources.
anyone have experience caching, dom objects? should opt php implementation of dom re-parsing, initializing dom isn't necessary each request?
you can cache pdo instance. have extend pdo class , implement __wakeup
, __sleep
magic method.
the __sleep()
method called before serialize()
, __wakeup
during unserialize()
(it's not precised when on manual).
you use __wakeup
method reestablish connection after unserialization memcache.
i don't think there lot of interest in caching pdo instance.
most core objects cannot cached. because not serialized properly. instances of classes implementing serializable
interface can be.
maybe in cases can work, if class has public properties.
Comments
Post a Comment