Cache Object without Using Serialize ?

NO, it is not possible to store a PHP object in a non-serialized form ; at least, not with the following caching solutions (I’ve tried these ones ; don’t know about the other that might exist) :

  • files
  • memcached
  • APC
  • Database (yeap, you can think about caching things in DB ^^ Drupal does it by default, for instance )
    If it takes that much time to unserialize your object, maybe it is really big ? Is there any way you could reduce it’s size ?

For instance, meybe you have a big bunch of HTML code in that object ? If so, could it be stored in another cache entry ?
(serialization is “transforming some data to a string ; so, if you are already working with a string, you don’t need to re-serialize it to store it in cache)

Or maybe it doesn’t take much time to create it from scratch ? In this case, is caching really necessary ?