#20331 closed defect (bug) (fixed)

Expire WP_Theme cache on updates and theme edits

Reported by: nacin Owned by: nacin
Priority: normal Milestone: 3.4
Component: Themes Version:
Severity: normal Keywords:
Cc:

Description (last modified by nacin)

When saving a file in wp-admin/theme-editor.php, we should force a cache delete.

Additionally, cache deletes should occur when an update occurs. Otherwise we may be reading old Version numbers from disk.

When deleting the cache, we will need to refresh the headers that exist in the current object instance. A simple $this->__construct() can re-initialize everything. This will enable us to call $theme->cache_delete() at any time to force fresh information.

Change History (3)

  • Description modified (diff)

Also, the timeout of 7200 is a bit too long. This was chosen as it was the timeout for theme roots in an earlier version. We can drop that to 1800 without any issues. WP.com uses something even smaller like 300.

In [20328]:

Clear theme cache after editing. Reduce default cache persistence to 1800. (Could go lower.) see #20331.

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

In [20329]:

Clear WP_Theme caches on update. fixes #20331.

Note: See TracTickets for help on using tickets.