Forum: Ruby on Rails Hot cache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Erik S. (Guest)
on 2008-10-16 16:35
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
Mark J. (Guest)
on 2008-10-17 10:26
(Received via mailing list)
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/rdo...

--
Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com
Jon S. (Guest)
on 2008-10-17 10:41
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/rdo...
>
> --
> Rails Wheels - Find Plugins, List & Sell Plugins -
> http://railswheels.com
This topic is locked and can not be replied to.