Hi,

Iam using Rails 3.1.0, i tried page, action and query cache.

I was not able to do :expires_in in some minutes for Page of Action
action cahe. How to do the same?

I tried the code like,

caches_page :index, :expires_in => 2.minutes

caches_action :create, :expires_in => 2.minutes

But Query cache work fine with caching and expiry when i used like
this,


@inc = Rails.cache.fetch("inc", :expires_in => 5.minutes)
{Inc.find(:all)}

Why page and action doesnt works with expires_in? It worked for me in
ealier versions of rails, how to do it in Rails 3.1?

I dont want to use cache stores(mem cache or dalli)

Please suggest me any ways?

Thanks in advance

--
Posted via http://www.ruby-forum.com/.

--
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@googlegroups.com.
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.

Search Discussions

  • Frederick Cheung at May 16, 2012 at 9:13 am

    On May 16, 6:21 am, martin devapitchai wrote:
    Hi,

    Iam using Rails 3.1.0, i tried page, action and query cache.

    I was not able to do :expires_in in some minutes for Page of Action
    action cahe. How to do the same?
    When you say that you weren't able to di it, what happened?

    I tried the code like,

    caches_page :index, :expires_in => 2.minutes

    caches_action :create, :expires_in => 2.minutes

    But Query cache work fine with caching and expiry when i used like
    this,

    @inc = Rails.cache.fetch("inc", :expires_in => 5.minutes)
    {Inc.find(:all)}

    Why page and action doesnt works with expires_in? It worked for me in
    ealier versions of rails, how to do it in Rails 3.1?

    I dont want to use cache stores(mem cache or dalli)
    Page caching just saves files to disk (with the assumption that the
    web server serves these without touching rails). This just doesn't
    support time base expiry on its own - there is no code that gets run
    when serving such a file to check whether the cache is still valid
    (although you could of course have some external bit of code that
    deletes old files from the cache directory).

    caches_action should work though, assuming that the underlying cache
    store used by action caching supports expiry (I don't believe file
    store does).

    Fred

    --
    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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 16, '12 at 5:21a
activeMay 16, '12 at 9:13a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase