• Resolved davidhorizon

    (@davidhorizon)


    Here’s an example of what I have on a lambda page :

    [1] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_ignore' LIMIT 1
                [1] => 0.00025820732116699
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [2] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_merge_allowed_urls' LIMIT 1
                [1] => 0.00016903877258301
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [3] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_default_protocol' LIMIT 1
                [1] => 0.00012397766113281
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [4] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_disable_js_merge' LIMIT 1
                [1] => 9.5129013061523E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [5] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_disable_css_merge' LIMIT 1
                [1] => 8.9168548583984E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [6] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_disable_js_minification' LIMIT 1
                [1] => 8.8214874267578E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [7] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_disable_css_minification' LIMIT 1
                [1] => 8.6069107055664E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [8] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_use_yui' LIMIT 1
                [1] => 7.6055526733398E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [9] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_remove_print_mediatypes' LIMIT 1
                [1] => 7.6055526733398E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [10] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_skip_html_minification' LIMIT 1
                [1] => 7.4863433837891E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [11] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_use_alt_html_minification' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [12] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_strip_htmlcomments' LIMIT 1
                [1] => 7.4863433837891E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [13] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_skip_cssorder' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [14] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_skip_google_fonts' LIMIT 1
                [1] => 7.8916549682617E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [15] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_skip_emoji_removal' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [16] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_enable_defer_js' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [17] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_exclude_defer_jquery' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [18] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_force_inline_css' LIMIT 1
                [1] => 7.9154968261719E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [19] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_force_inline_css_footer' LIMIT 1
                [1] => 7.8916549682617E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [20] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_force_inline_googlefonts' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [21] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_remove_googlefonts' LIMIT 1
                [1] => 7.3909759521484E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [22] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_defer_for_pagespeed' LIMIT 1
                [1] => 7.3909759521484E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [23] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_exclude_defer_login' LIMIT 1
                [1] => 7.4148178100586E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [24] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_preload' LIMIT 1
                [1] => 7.7962875366211E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [25] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_preconnect' LIMIT 1
                [1] => 7.4863433837891E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [26] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_fvm_fix_editor' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [27] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_send_css_to_footer' LIMIT 1
                [1] => 7.2956085205078E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [28] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_critical_css_tester' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [29] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_critical_path_visibility' LIMIT 1
                [1] => 7.4863433837891E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [30] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_critical_path_css' LIMIT 1
                [1] => 7.3909759521484E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [31] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_generate_gulp_files' LIMIT 1
                [1] => 7.3909759521484E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [32] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_generate_gulp_path' LIMIT 1
                [1] => 7.8916549682617E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [33] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_fvm_cdn_url' LIMIT 1
                [1] => 7.5101852416992E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
    
        [34] => Array
            (
                [0] => SELECT option_value FROM ah_options WHERE option_name = 'fastvelocity_min_fvm_removecss' LIMIT 1
                [1] => 7.7962875366211E-5
                [2] => require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/fast-velocity-minify/fvm.php'), get_option
            )
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Raul P.

    (@alignak)

    You probably don’t know, but those queries are faster than to have a single queries with serialize/unserialize data, in most options.

    Furthermore, if you care about performance to the level that you consider queries that take under 2 milliseconds, you probably should have PHP object cache.

    And if you do, those queries come from the get_option function, which means these queries are cached (as ong as you have saved the settings on the plugin page at least once).
    And this will be stored on the object cache, so it doesn’t query the database every time.

    It’s more expensive to serialize and unserialize, that to leverage the usage of wordpress core cache, but I do admit that as the functionalities have been added, more queries exist.

    About how this cache works:
    https://wordpress.stackexchange.com/questions/102555/is-get-option-function-cached
    https://tommcfarlin.com/wordpress-object-cache/
    https://wptavern.com/persistent-object-caching

    Thread Starter davidhorizon

    (@davidhorizon)

    Hello (<- sorry I forgot last time),

    website performance is an accumulated optimisation of milliseconds ?? Also options table can become really heavy and so does queries. And it look like your plugin doesn’t need these values on front end. I just tried the following :

    if (is_admin())
    {

    # options from the database, false if not set
    $ignore = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_ignore’, ”)));
    $blacklist = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_blacklist’, ”)));
    $ignorelist = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_ignorelist’, ”)));
    $merge_allowed_urls = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_merge_allowed_urls’, ”)));
    $default_protocol = get_option(‘fastvelocity_min_default_protocol’, ‘dynamic’);
    $disable_js_merge = get_option(‘fastvelocity_min_disable_js_merge’);
    $disable_css_merge = get_option(‘fastvelocity_min_disable_css_merge’);
    $disable_js_minification = get_option(‘fastvelocity_min_disable_js_minification’);
    $disable_css_minification = get_option(‘fastvelocity_min_disable_css_minification’);
    $use_yui = get_option(‘fastvelocity_min_use_yui’);
    $remove_print_mediatypes = get_option(‘fastvelocity_min_remove_print_mediatypes’);
    $skip_html_minification = get_option(‘fastvelocity_min_skip_html_minification’);
    $use_alt_html_minification = get_option(‘fastvelocity_min_use_alt_html_minification’);
    $strip_htmlcomments = get_option(‘fastvelocity_min_strip_htmlcomments’);
    $skip_cssorder = get_option(‘fastvelocity_min_skip_cssorder’);
    $skip_google_fonts = get_option(‘fastvelocity_min_skip_google_fonts’);
    $skip_emoji_removal = get_option(‘fastvelocity_min_skip_emoji_removal’);
    $enable_defer_js = get_option(‘fastvelocity_min_enable_defer_js’);
    $exclude_defer_jquery = get_option(‘fastvelocity_min_exclude_defer_jquery’);
    $force_inline_css = get_option(‘fastvelocity_min_force_inline_css’);
    $force_inline_css_footer = get_option(‘fastvelocity_min_force_inline_css_footer’);
    $force_inline_googlefonts = get_option(‘fastvelocity_min_force_inline_googlefonts’);
    $remove_googlefonts = get_option(‘fastvelocity_min_remove_googlefonts’);
    $defer_for_pagespeed = get_option(‘fastvelocity_min_defer_for_pagespeed’);
    $exclude_defer_login = get_option(‘fastvelocity_min_exclude_defer_login’);
    $preload = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_preload’)));
    $preconnect = array_map(‘trim’, explode(“\n”, get_option(‘fastvelocity_min_preconnect’)));
    $fvm_fix_editor = get_option(‘fastvelocity_min_fvm_fix_editor’);
    $send_css_to_footer = get_option(‘fastvelocity_min_send_css_to_footer’);
    $critical_css_tester = get_option(‘fastvelocity_min_critical_css_tester’);
    $critical_css_path_visibility = get_option(‘fastvelocity_min_critical_path_visibility’);
    $critical_path_css = get_option(‘fastvelocity_min_critical_path_css’);
    $generate_gulp_files = get_option(‘fastvelocity_min_generate_gulp_files’);
    $generate_gulp_path = get_option(‘fastvelocity_min_generate_gulp_path’);
    $fvm_cdn_url = get_option(‘fastvelocity_min_fvm_cdn_url’);
    $fvm_remove_css = get_option(‘fastvelocity_min_fvm_removecss’);

    }

    and then it’s just do no queries at all on front end.

    You are right about wordpress cache but it’s not available on every host and it take time to setup.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Look nice but does a lot of queries’ is closed to new replies.