I have a rails controller which must return a .csv file and I'd like this page to use cache. The cache works fine when I use a .xml format (it returns 304 http status), but when the format is csv, it always returns 200 http status.
here is my controller code:
def index
@machines = Machine.all
respond_to do |wants|
wants.xml { render :xml => @machines.to_xml }
wants.csv
end
end
I've tried to put
caches_page :index
but it doesn't work.