How to let ajax request be cached?

Yesterday I was told here that the ajax request can not be cached
because rails cache mechanism only admit the http get request and ajax
is always post. However there are lots of ajax in my application,how to
let the ajax requested actions/views be cached?

On Aug 23, 2006, at 8:33 AM, fred wrote:

Yesterday I was told here that the ajax request can not be cached
because rails cache mechanism only admit the http get request and ajax
is always post. However there are lots of ajax in my
application,how to
let the ajax requested actions/views be cached?

It requires a little bit more work, but you can specify that your
AJAX queries be GET.

See:

http://www.mnot.net/blog/2006/08/14/webizing_ajax

for a description of the javascript.

Within rails, you probably want the :method parameter, eg.

form_remote_tag :method => 'get'

James.


James S. : Freelance Web D.
Work : http://jystewart.net
Play : http://james.anthropiccollective.org