Some thoughts about encoding <-> caching

  • Anonymous

    Anonymous - 2004-02-15

    I was wondering why the encoding procedures are completely different from the ones used when caching. Since both have the goal to serialize the zend op_array + class/function hashes into a file (or smm), why not recycle the caching procedures to produce an encoded file? (of course, applying gz and others). Is there a specific reason why this isn't done?

    ( i note that caching to files does quite aggressive checks on the php/zend version, and that doesn't happen to encoded files. so i wonder again, if encoding works without a php/zend version limitation, why can't the cache do without it)

    Also, when encoding, it seems to me that encoding must be triggered from a php file, that passes the file that is to be encoded as a parameter. The same goes for loading that encoded file back. Is it possible to let mmcache auto-detect an encoded file when someone tries to execute an encoded file? If it isn't implemented i'll probably make a patch for it, since i need such functionality :)

    • Jason Sheets

      Jason Sheets - 2004-03-19

      If you are able to do a patch it would be considered, the problem with auto-detecting bytecode is there are many other encoders out there that also create incompatable bytecode, making an auto detection method somewhat high in overhead.

      If you need automatic loading you might consider phpcoder, it automatically wraps the encoded file with the proper function calls.

      One option would be to prefix the bytecode with a flag that MMCache would pick up and parse the byte code I guess, if you have a suggestion or patch please send it in.


Log in to post a comment.