How to invoke a GET request to home page

The homepage of my application has time sensitive data. The homepage is
cached for fast loading.

However I clean out the cache every day midnight. It means the first
person
who hits the after the cache clean up has to wait extra long.

The cache is cleaned out using a rake job. Is there a way I could write
a
rake job to just go and hit the homepage and generate the cache page
just
after the cache is cleaned out.

Raj S. wrote:

The homepage of my application has time sensitive data. The homepage is
cached for fast loading.

However I clean out the cache every day midnight. It means the first
person
who hits the after the cache clean up has to wait extra long.

The cache is cleaned out using a rake job. Is there a way I could write
a
rake job to just go and hit the homepage and generate the cache page
just
after the cache is cleaned out.

create the task to run in the correct order (after the cache is cleaned
out) and put in a dependency to run the following ruby-code

require 'net/http'
Net::HTTP.get_print 'www.my-rails-domain.com', '/'

…would this work?

That would work, However I would suggest a different approach,
consider looking at CRON if your on a linux computer and adding the
rake task to the cron tab. This will run rake at certian time
intervals and will work even after a restart. Most shared hosts allow
you to run cron tasks.

On Jul 15, 5:29 pm, Shai R. [email protected]