WordPress.org

Ready to get started?Download WordPress

Forums

update_site_option( ) fails for (pretty) large data (5 posts)

  1. DrLightman
    Member
    Posted 3 years ago #

    I cannot test this on 3.0.1 right now.

    By the way, I'm trying to cache a result set for 5 minutes into a site option with update_site_option( ) and get_site_option( ), but update_site_option( ) fails.

    The variable array is there, I dumeped the serialized version into a .txt, it comes out a 1.09MB file.

    But if I try to store it with:

    update_site_option('my_result_set_cache', $data);

    The function doesn't return false.

    The meta_value corresponding to the 'my_result_set_cache' meta_key turns out to be empty.

    I tried to bypass the automatic serialization by serializing the variable myself, but I'm not sure it would work dued to THIS, I fear a double serialization and if I do that by the way the function return false.

    I tried to deflate the serialized version to reduce the size to about 350KB, but it failed again.

    Testing with a smaller variable or simple string, works normally.

    What am I doing wrong?

    edit: I did a test with update_option( ) and it's the same.

    edit2: tested on my local web server (Vista, Apache2, PHP5, MySQL5, WP 3.0.1 no plugins, php memory_limit=512M) and it fails too, no option is created and the add_option function returns false.

  2. DrLightman
    Member
    Posted 3 years ago #

    Further local testing results:

    $v = array();
    for( $i=0; $i<34181; $i++ ) {
        $v[] = uniqid(  );
    }
    if( !update_option( 'foobar', $v ) ) {
    	echo 'FFFFFFFUUUUUUUUUUUUUUUU';
    }

    With values lesser of about 34181 update_option WORKS, above 34180 it fails. The serialized version size turns out to be 980120 bytes when it works. Above, it fails.

  3. DrLightman
    Member
    Posted 3 years ago #

    No one experienced this? :)

  4. If you're still on 2.9.2, anyone who has experienced this has upgraded. ;) Either its fixed (likely) or simply no one has experienced the same issue.

  5. DrLightman
    Member
    Posted 3 years ago #

    edit2: tested on my local web server (Vista, Apache2, PHP5, MySQL5, WP 3.0.1 no plugins, php memory_limit=512M) and it fails too, no option is created and the add_option function returns false.

    Happens on WP 3.0.1 too.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.