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.

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.