Make WordPress Core


Ignore:
Timestamp:
02/01/2007 08:53:08 AM (20 years ago)
Author:
markjaquith
Message:

Introduce Notoptions and Alloptions caching, so that all options (and previously attempted Notoptions) are read from the cache in one go. Should reduce cache misses to zero or close to it. fixes #3726

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cache.php

    r4686 r4855  
    192192                                        $this->cache['category'][$catt->cat_ID] = $catt;
    193193                        }
    194                 } else
    195                         if ('options' == $group) {
    196                                 $wpdb->hide_errors();
    197                                 if (!$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'")) {
    198                                         $options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options");
    199                                 }
    200                                 $wpdb->show_errors();
    201 
    202                                 if ( ! $options )
    203                                         return;
    204 
    205                                 foreach ($options as $option) {
    206                                         $this->cache['options'][$option->option_name] = $option->option_value;
    207                                 }
    208                         }
     194                }
     195
    209196        }
    210197
Note: See TracChangeset for help on using the changeset viewer.