# Hot cache

**URL:** <https://www.ruby-forum.com/t/hot-cache/151069>\
**Category:** Rails\
**Created:** [October 16, 2008, 2:35pm UTC](https://www.ruby-forum.com/t/hot-cache/151069 "2008-10-16T14:35:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stonebreaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@stonebreaker](https://www.ruby-forum.com/u/stonebreaker)\
**Post date:** [October 16, 2008, 2:35pm UTC](https://www.ruby-forum.com/t/hot-cache/151069/1 "2008-10-16T14:35:05Z")

</div>

Hi,

I have a page that takes about 1 second to generate, when the amount of  
data is large. This page is cached. When new data is comming in and  
imported by a background process I want to rebuild the cached pages  
becouse, mean will the first hit comes to the pages is cached by rails I  
have 40 requests.

So how will i best trigger and action on a controller from my background  
process (running with workling)

Thanks  
Jon

---

<div class="post-metadata">

**Author:** ![stonebreaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@stonebreaker](https://www.ruby-forum.com/u/stonebreaker)\
**Post date:** [October 17, 2008, 8:26am UTC](https://www.ruby-forum.com/t/hot-cache/151069/2 "2008-10-17T08:26:15Z")

</div>

Jon S. wrote:

> I have a page that takes about 1 second to generate, when the amount of  
> data is large. This page is cached. When new data is comming in and  
> imported by a background process I want to rebuild the cached pages  
> becouse, mean will the first hit comes to the pages is cached by rails I  
> have 40 requests.
> 
> So how will i best trigger and action on a controller from my background  
> process (running with workling)

Just use Net:HTTP.get

[http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001199](http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001199)

–  
Rails Wheels - Find Plugins, List & Sell Plugins -  
[http://railswheels.com](http://railswheels.com)

---

<div class="post-metadata">

**Author:** ![stonebreaker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@stonebreaker](https://www.ruby-forum.com/u/stonebreaker)\
**Post date:** [October 17, 2008, 8:41am UTC](https://www.ruby-forum.com/t/hot-cache/151069/3 "2008-10-17T08:41:30Z")

</div>

Yes, is’t that really the same as let the first user generate the page  
after I deleted the stalled cached page. My problem is that i have 40  
users requesting the dynamic content before the first one is cached. At  
least the appears like that in the logfile, and my mongrel queue grows  
large during this time.

Mark J. wrote:

> Jon S. wrote:
> 
> > I have a page that takes about 1 second to generate, when the amount of  
> > data is large. This page is cached. When new data is comming in and  
> > imported by a background process I want to rebuild the cached pages  
> > becouse, mean will the first hit comes to the pages is cached by rails I  
> > have 40 requests.
> > 
> > So how will i best trigger and action on a controller from my background  
> > process (running with workling)
> 
> Just use Net:HTTP.get
> 
> [http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001199](http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001199)
> 
> –  
> Rails Wheels - Find Plugins, List & Sell Plugins -  
> [http://railswheels.com](http://railswheels.com)
