Make WordPress Core

Opened 15 months ago

Last modified 13 months ago

#26394 new enhancement

In update_option if option is missing add the option with autoload no

Reported by: codix Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.7
Component: Options, Meta APIs Keywords:
Focuses: performance Cc:


Right now if an option is not added with add_option and subsequently updated it will be added as autoload yes. This would work fine in most cases. But it becomes a problem if the total size of autoload options exceed 1024*1024-42 bytes with memecache with default configuration and object cache with memcache backend. Also storing 1024*1024 bytes of data per blog in a very large multi site environment is not best use of resources.

I propose update_option to add options with autoload no as many developers just use update_option to even add options.

Attachments (2)

patch.diff (726 bytes) - added by codix 15 months ago.
26394.diff (400 bytes) - added by nofearinc 15 months ago.
patch refresh

Download all attachments as: .zip

Change History (7)

@codix15 months ago

comment:1 @SergeyBiryukov15 months ago

  • Version changed from trunk to 3.7

@nofearinc15 months ago

patch refresh

comment:2 @nofearinc15 months ago

I've uploaded a SVN diff of the patch for compatibility. Did you use git diff --no-prefix to get the patch as it should be the right way to do it?

Additionally, I agree with your concerns, but given the fact that add_option sets autoload as yes by default, I'm not sure if that the patch is not against the defaults expected in add_option.

comment:3 @uglyrobot15 months ago

I agree that 'yes' should be the default, but it would be AWESOME to be able to add an autoload argument to update_option(). As said almost no one uses add_option() first.

comment:4 @jartes14 months ago

  • Cc joan@… added

comment:5 @nacin13 months ago

  • Component changed from Performance to Options and Meta
  • Focuses performance added
Note: See TracTickets for help on using tickets.