I have an action. It renders files specified by URL. If the file is a source code, the action will do something on it, like highlighting. If the file is a plaintext or an image, the action just sends it as is. This code works until I turn on cache on this action. With cache enabled, the second time to access a URL will result in a prompt dialog asking if you want to download it. I guess it is related to the mimetype. But don''t know how to solve it:( --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The Rails action_cache does not keep the headers returned from the first request that causes the data to be cached. On subsequent requests, if you set the correct response.headers for the file *after* the action cache before filter, then you will get the default headers (text/html content type) My action_cache filter will keep the headers returned, and will return the same ones on subsequent requests. Just install the plugin and restart your app -- for this fix, no other configuration is needed. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
So where can I get your plugin? Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I found it. http://www.agilewebdevelopment.com/plugins/action_cache On 2月15日, 下午2时29分, "Tiger Dong" <idlecat...@gmail.com> wrote:> So where can I get your plugin? Thanks in advance.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben''s agile development site is always the best place to find plugins. On Feb 14, 10:34 pm, "Tiger Dong" <idlecat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I found it.http://www.agilewebdevelopment.com/plugins/action_cache > > On 2月15日, 下午2时29分, "Tiger Dong" <idlecat...@gmail.com> wrote: > > > So where can I get your plugin? Thanks in advance.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Opps, I''ve installed your plugin but still have the problem. It''s my first time to use rails plugin. I am not sure if I''ve done things right. I installed the plugin by "./script/plugin install http://craz8.com/ svn/trunk/plugins/action_cache". But how can I know this plugin is working? On Feb 15, 3:37 pm, "Tom Fakes" <t...-SpgrXpdGZSiNACpsiTyfug@public.gmane.org> wrote:> Ben''s agile development site is always the best place to find plugins. > > On Feb 14, 10:34 pm, "Tiger Dong" <idlecat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I found it.http://www.agilewebdevelopment.com/plugins/action_cache > > > On 2月15日, 下午2时29分, "Tiger Dong" <idlecat...@gmail.com> wrote: > > > > So where can I get your plugin? Thanks in advance.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you setting the correct mime type in your action that returns the file? Can you post the code for that action? On Feb 15, 6:39 am, "Tiger Dong" <idlecat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Opps, I''ve installed your plugin but still have the problem. It''s my > first time to use rails plugin. I am not sure if I''ve done things > right. > > I installed the plugin by "./script/plugin installhttp://craz8.com/ > svn/trunk/plugins/action_cache". But how can I know this plugin is > working? > > On Feb 15, 3:37 pm, "Tom Fakes" <t...-SpgrXpdGZSiNACpsiTyfug@public.gmane.org> wrote: > > > Ben''s agile development site is always the best place to find plugins. > > > On Feb 14, 10:34 pm, "Tiger Dong" <idlecat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I found it.http://www.agilewebdevelopment.com/plugins/action_cache > > > > On 2月15日, 下午2时29分, "Tiger Dong" <idlecat...@gmail.com> wrote: > > > > > So where can I get your plugin? Thanks in advance.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Now I am using caches_action instead of caches_page and it works. Is this a "Work as design"? BTW: I think your plugin is useful. Can you make it default in rails? I am not clear about rails development model. Just wondering. Anyway, thanks a lot. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---