Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#12671 closed (fixed)

Add set_many, delete_many, clear to cache

Reported by: Jeff Balogh Owned by: Jeff Balogh
Component: Core (Cache system) Version: 1.2-alpha
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The attached patch adds all three, with accompanying tests and docs.

set_many and delete_many are convenient, but not really any big gain for non-memcached backends. For memcached, they're an improvement if you're setting or deleting a bunch of keys at once, since you avoid extra latency and network traffic. It also provides symmetry with get_many.

clear is nice for tests and development when you need a full flush, and in production when there's a code upgrade that changes the shape of cached objects.

I can split the patch into multiple, smaller patches if it makes things easier. I was in there and wanted all three, so I wrote everything at once.

On the docs: the cache section is getting littered with versionadded directives, and the new methods might be getting kind of lost. A new "High Efficiency" section might be in order, to separate methods that act on a single key from methods that act on many keys (get_many, set_many, delete_many, and cache). Thoughts?

Also, I'm not excited about continuing the (timeout=0 => default timeout) debacle, but it's better for consistency.

Attachments (1)

cache.diff (10.2 KB ) - added by Jeff Balogh 14 years ago.
Adds set_many, delete_many, and clear methods to cache

Download all attachments as: .zip

Change History (7)

comment:1 by Jeff Balogh, 14 years ago

Owner: changed from nobody to Jeff Balogh
Status: newassigned

comment:2 by Alex Gaynor, 14 years ago

Patch looks pretty good, probably just about RFC. One thing though, you seem to have put the versionadded directives *below* the section in the docs, as opposed to above them which is the standard in the rest of the docs.

by Jeff Balogh, 14 years ago

Attachment: cache.diff added

Adds set_many, delete_many, and clear methods to cache

in reply to:  2 comment:3 by Jeff Balogh, 14 years ago

Replying to Alex:

you seem to have put the versionadded directives *below* the section in the docs

Attachment 2, now with more betterness.

comment:4 by Alex Gaynor, 14 years ago

milestone: 1.2

Marking for the 1.2 milestone so I remember to ask russ to commit this.

comment:5 by Alex Gaynor, 14 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r12306.

comment:6 by Jacob, 12 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top