If I have an action which can render multiple formats (e.g. html, js, rss), is it possible to page-cache all of these formats? I can''t see how to do it with ''caches_page''. It looks like you can only override ''page_cache_extension'' at the class level: http://github.com/rails/rails/blob/master/actionpack/lib/action_controller/caching/pages.rb#L49 I''d like to dynamically tie the page_cache_extension to my format somehow. Is this possible? Thanks, -- Chad -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
matthewrudyjacobs@gmail.com
2010-Jan-31 14:47 UTC
Re: Page caching different formats for same action?
this definitely worked for me last time I tried. Notably you''d need the format in the path. /some/action.js should be correctly cached as /public/some/action.js On Jan 31, 5:16 pm, Chad Woolley <thewoolley...@gmail.com> wrote:> If I have an action which can render multiple formats (e.g. html, js, > rss), is it possible to page-cache all of these formats? > > I can''t see how to do it with ''caches_page''. It looks like you can > only override ''page_cache_extension'' at the class level: > > http://github.com/rails/rails/blob/master/actionpack/lib/action_contr... > > I''d like to dynamically tie the page_cache_extension to my format > somehow. Is this possible? > > Thanks, > -- Chad-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.