# HowTo autogenerate a cahced page that was deleted

**URL:** <https://www.ruby-forum.com/t/howto-autogenerate-a-cahced-page-that-was-deleted/71916>\
**Category:** Rails\
**Created:** [October 12, 2006, 11:18am UTC](https://www.ruby-forum.com/t/howto-autogenerate-a-cahced-page-that-was-deleted/71916 "2006-10-12T11:18:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7993a0/32.png) [@nuero](https://www.ruby-forum.com/u/nuero)\
**Post date:** [October 12, 2006, 11:18am UTC](https://www.ruby-forum.com/t/howto-autogenerate-a-cahced-page-that-was-deleted/71916/1 "2006-10-12T11:18:52Z")

</div>

Hi

I am using “caches\_page :index” to cache a page.  
I delete this file via a cron tab command every 1 hour.  
However, right after the file is deleted the very next user experiences  
a huge delay because the page is being generated.

Is there anyway to autogenerate the file before the very next user  
requests the page? A unix or ruby solution would do.

thanks,  
– nueromancer

---

<div class="post-metadata">

**Author:** ![nuero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7993a0/32.png) [@nuero](https://www.ruby-forum.com/u/nuero)\
**Post date:** [October 12, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/howto-autogenerate-a-cahced-page-that-was-deleted/71916/2 "2006-10-12T18:49:53Z")

</div>

nuero wrote:

> Hi
> 
> I am using “caches\_page :index” to cache a page.  
> I delete this file via a cron tab command every 1 hour.  
> However, right after the file is deleted the very next user experiences  
> a huge delay because the page is being generated.
> 
> Is there anyway to autogenerate the file before the very next user  
> requests the page? A unix or ruby solution would do.
> 
> thanks,  
> – nueromancer

Caching is done when a page is viewed. Get your cronjob to load the  
page with something like:

curl [yourdomain.com is available for purchase - Sedo.com](http://yourdomain.com/my/cacheable/page)

---

<div class="post-metadata">

**Author:** ![nuero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7993a0/32.png) [@nuero](https://www.ruby-forum.com/u/nuero)\
**Post date:** [October 13, 2006, 3:22am UTC](https://www.ruby-forum.com/t/howto-autogenerate-a-cahced-page-that-was-deleted/71916/3 "2006-10-13T03:22:20Z")

</div>

Alex W. wrote:

> curl [yourdomain.com is available for purchase - Sedo.com](http://yourdomain.com/my/cacheable/page)

thanks Alex  
–nuero
