Hot cache


#1

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


#2

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


Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com


#3

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


Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com