Opened 20 months ago

Last modified 10 months ago

#18803 new feature request

Core hooks for fragment caching

Reported by: sivel Owned by: sivel
Priority: normal Milestone: Future Release
Component: Template Version: 3.3
Severity: normal Keywords: has-patch dev-feedback
Cc: freshman66, zack@…, mike.schroder@…, aaroncampbell, mikeschinkel@…, Brian@…

Description

I have been running fragment caching for some time, but have seen a few negatives with the way it needs to be implemented currently. With fragment caching potentially becoming even more popular after talks given at WordCamps, core hooks to assist in this are going to become more necessary, for several reasons, such as creating some standardization about how it is integrated into the theme.

Since there are no hooks in something like get_sidebar() -> get_template_part() -> locate_template() -> load_template() you have to create your own function calls to use in a theme to render the sidebar.

In my specific case I was using a child theme, and ended up having to copy over a lot of the parent theme files to make the modification.

My goal is to provide some hooks that would allow use of the standard theme functions such as get_sidebar() but give a plugin or similar access to interrupt the process, generate the cache and output the cache.

My first pass is attached as well as a sample mu-plugin that I have wrote to show how you can use the new hooks to perform fragment caching.

Attachments (2)

18803.diff (892 bytes) - added by sivel 20 months ago.
cache-load-template.php (1.3 KB) - added by sivel 20 months ago.

Download all attachments as: .zip

Change History (10)

sivel20 months ago

sivel20 months ago

  • Cc freshman66 added
  • Milestone changed from Awaiting Review to 3.4
  • Cc zack@… added
  • Cc mike.schroder@… added
  • Milestone changed from 3.4 to Future Release

Cool, but punting from 3.4 per bug scrub.

  • Cc aaroncampbell added
  • Cc mikeschinkel@… added
  • Cc Brian@… added
Note: See TracTickets for help on using tickets.