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.
4673fc544f019d10f3162022e1c07c90?d=identicon&s=25 Erik Svensson (stonebreaker)
on 2008-10-16 14: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
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark James (Guest)
on 2008-10-17 08:26
(Received via mailing list)
Jon Stenqvist 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
A4d90c6fe98bfe0b491c277c3e687031?d=identicon&s=25 Jon Stenqvist (jnstq)
on 2008-10-17 08: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 James wrote:
> Jon Stenqvist 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.