timed_fragment_cache always expires

Are you running in development mode? Did you set:

config.action_controller.perform_caching = true

in environments/development.rb

Cheers,

Nick.

Carsten Gehling wrote:

Hi,

I am facing the same problem using timed_fragment_cache plugin.
And do all the steps i need to do.
it works fine for time being cache.
But for the left all it not work it expires.

Any Idea?

Arun Agrawal

Carsten Gehling wrote:

Arun Agrawal wrote:

Hi,

I am facing the same problem using timed_fragment_cache plugin.
And do all the steps i need to do.
it works fine for time being cache.
But for the left all it not work it expires.

I ended up choosing another approach. I am using the normal cache
system. Then I made a cronjob, that deletes the cache files after after
a certain amount of time.

- Carsten

Carsten, Just out of curiosity, Was that because of a limitation in
the plugin or you just wanted a cron based solution?
Are you using capistrano to setup that cron job? Cos otherwise it
seems like another bit to configure unless of course the plugin didnt
meet your requirements.

Cheers,
Aditya

Aditya wrote:

Carsten, Just out of curiosity, Was that because of a limitation in
the plugin or you just wanted a cron based solution?
Are you using capistrano to setup that cron job? Cos otherwise it
seems like another bit to configure unless of course the plugin didnt
meet your requirements.

Oh it was simply, that I never succeded in getting the fragments to
time-out and be rebuilt. After using 2 days on it, I had to quickly find
another solution.

Our site was suddenly having a LOT of requests due to a TV commercial so
I just had to get some cache to work quickly.

- Carsten

Just a question on the original code.

Shouldn't the line
when_fragment_expired('front_popular_races', 10.minutes.ago) do

be
when_fragment_expired('front_popular_races', 10.minutes.from_now) do

?

Perhaps that's the reason why the cache always expires.

Sean Tan wrote:

Just a question on the original code.

Shouldn't the line
when_fragment_expired('front_popular_races', 10.minutes.ago) do

be
when_fragment_expired('front_popular_races', 10.minutes.from_now) do

?

Perhaps that's the reason why the cache always expires.

Possibly. It's been so long since I tried it. But I think, that I tested
both cases, because I was in doubt myself.

Anyway it's so long ago. :slight_smile:

- Carsten