WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 2 months ago

#24686 closed enhancement (wontfix)

Introduce generic filter on transient return value

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Cache API Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

The get_transient() and get_site_transient() functions have a filter on their return value, but the filter name contains the transient key: transient_{$transient}.

This means it's not possible to hook into the return value for every transient in order to do something like logging transient hits and misses.

Attachments (1)

24686.patch (611 bytes) - added by johnbillion 10 months ago.

Download all attachments as: .zip

Change History (8)

johnbillion10 months ago

comment:1 johnbillion10 months ago

  • Keywords has-patch added

comment:2 johnbillion10 months ago

Note that the patch on ticket #24685 is needed in conjunction with this to be of any real use.

comment:3 wonderboymusic8 months ago

  • Milestone changed from Awaiting Review to 3.7

comment:4 nacin8 months ago

Do we do anything similar for options, meta, or cache?

comment:5 johnbillion8 months ago

Nope, we don't do it for options, meta, or cache. I think it has a use case for transients though (and possibly the object cache, although that could impact performance). My use case is for logging hits and misses when fetching transients.

comment:6 nacin7 months ago

  • Keywords 2nd-opinion added
  • Milestone changed from 3.7 to Future Release

IRC discussion: http://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2013-09-17&sort=asc#m689641

Maybe an 'expired_transient' action would be useful. But if you're using a cache backend, you'll get hit and miss statistics automatically.

comment:7 johnbillion2 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.