Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6642 (closed defect: fixed)

Opened 2 years ago

Last modified 5 months ago

[PATCH] Make fragment caching work in non non-erb templates too

Reported by: zsombor Assigned to: David
Priority: normal Milestone: 1.2.7
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Currently it is not possible to use fragment caching for rxml (and perhaps less importantly rjs) templates. This patch intends to solve this annoying itch in a compatible way. I've also added missing unit tests for fragment caching in general. Should be ok.

Attachments

fragment_caching_for_non_erb_templates.diff (13.2 kB) - added by zsombor on 11/18/06 02:01:32.
fragment_caching_for_non_erb_templates.2.diff (8.2 kB) - added by mpalmer on 07/23/07 00:48:47.
fragment_caching_for_non_erb_templates3.diff (14.2 kB) - added by zsombor on 12/20/07 09:21:19.
Patch against /trunk @8440

Change History

11/18/06 02:01:32 changed by zsombor

  • attachment fragment_caching_for_non_erb_templates.diff added.

07/23/07 00:48:47 changed by mpalmer

  • attachment fragment_caching_for_non_erb_templates.2.diff added.

07/23/07 00:51:54 changed by mpalmer

  • keywords deleted.

Patch didn't apply cleanly to current edge, due to a pile of utterly unrelated whitespace cleanups (don't do that, FFS!). I've cleaned up the patch. What I didn't clean up were the author's deviations from the standard Rails coding conventions; I'll leave that for someone else (as I'm not 100% sure I'll get them all)

On the evaluation front, the tests fail spectacularly before the live code is applied, and they all work fine afterwards. I'm not an expert in the problem domain, but it certainly doesn't seem egregiously unpleasant. +1 overall.

07/23/07 07:51:49 changed by zsombor

Great finally a response after 8 months. The whitespace changes ere introduced due to different behavior of editors i.e. some add spurious whitespace before the end of line, others (like mine) don't. Not something intentional, thanks for understanding.

I'm generating HTML/JS/XML output, the HTML was fast due to fragment caching but XML requests were killing me. Fragment caching currently works with erb templates only, and this is not practical if you generate more than one type of content. The "fragment_for" method can be used to add caching for other types like HAML etc.

12/17/07 00:24:41 changed by david

  • status changed from new to closed.
  • resolution set to incomplete.

This needs to be updated for trunk as we now use erb, builder, and so on as the extensions. Sorry for shuffling this around for so long. It's a great patch, I'd love to see it in. I'm now on email notification for it, so when you update it, we can get it in and I'll be alerted. Please reopen when done. Thanks and sorry for the processing time :/

12/20/07 09:19:58 changed by zsombor

  • status changed from closed to reopened.
  • resolution deleted.

Thanks David, updated against /trunk.

12/20/07 09:21:19 changed by zsombor

  • attachment fragment_caching_for_non_erb_templates3.diff added.

Patch against /trunk @8440

01/03/08 15:35:15 changed by david

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [8542]) Made fragment caching in views work for rjs and builder as well (closes #6642) [zsombor]