WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#22503 closed defect (bug) (fixed)

wp_mime_type_icon() fails to properly cache icons

Reported by: nacin Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Cache API Keywords:
Focuses: Cc:

Description

It does this:

$icon_files = wp_cache_get('icon_files');

And:

wp_cache_set('icon_files', $icon_files, 600);

See the issue? I spent an embarrassing amount of time debugging the caching backend before I did. The timeout of "600" is actually the cache group in that call. We need to slip in a 'default' there.

Noticed while doing profiling for #22186. If you're calling this function for a whole bunch of attachments, all of those repetitive disk scans can slow things down quite a bit.

Change History (2)

#1 @nacin
8 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 22674:

Call wp_cache_set() with a group and then an expiration in wp_mime_type_icon(). fixes #22503. see #22186.

#2 @nacin
8 years ago

In 22676:

This should be a cache add, not a cache set. see #22503.

Note: See TracTickets for help on using tickets.