heya, I''m sure others have run into this, but using conditional GETs has some fun side effects if you''re rendering a page that has a flash message and the (browser) cached version doesn''t contain the flash, the user never sees the flash and vice-versa if the browser cached page has a flash the flash is displayed for as long as the page is cached. Nothing new there though, it''s caching 101, but I''m wondering if it makes sense to accommodate for this in the ActionController helpers (fresh?/stale?/fresh_when, by either setting another etag/modified if the flash hash is non-empty or always including the flash hash''s checksum as part of the etag. What''s the general opinion here, is this something that should be left up to the developer or should rails handle this? Cheers, JS --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Nothing new there though, it''s caching 101, but I''m wondering if it > makes sense to accommodate for this in the ActionController helpers > (fresh?/stale?/fresh_when, by either setting another etag/modified if > the flash hash is non-empty or always including the flash hash''s > checksum as part of the etag. What''s the general opinion here, is this > something that should be left up to the developer or should rails > handle this?I don''t think it''s something we should bake in. There are many other session or environment variables that could control the view as well. If you''re doing conditional get on a page, you need to make sure that all the variables that controls the look of that page is included in the cache key. Whether it''s a record, a flash message, another session variable, or whatever. -- DHH --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The flash has no other purpose but the display of messages in the view, right? The other session stuff we can''t assume anything about, but the flash? On Sun, Mar 22, 2009 at 12:14 PM, DHH <david.heinemeier@gmail.com> wrote:> >> Nothing new there though, it''s caching 101, but I''m wondering if it >> makes sense to accommodate for this in the ActionController helpers >> (fresh?/stale?/fresh_when, by either setting another etag/modified if >> the flash hash is non-empty or always including the flash hash''s >> checksum as part of the etag. What''s the general opinion here, is this >> something that should be left up to the developer or should rails >> handle this? > > I don''t think it''s something we should bake in. There are many other > session or environment variables that could control the view as well. > If you''re doing conditional get on a page, you need to make sure that > all the variables that controls the look of that page is included in > the cache key. Whether it''s a record, a flash message, another session > variable, or whatever. > -- > DHH > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---