Merge branch '10312-nodemanager-quotas' refs #10312
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index a63fe6e21f1311a353392a2bc2f27f656147bee5..0a40f58f21512b479f130fa6de773eac9703700a 100644 (file)
@@ -1234,8 +1234,15 @@ class ApplicationController < ActionController::Base
         @objects_for[obj.name] = obj
       end
     else
+      key_prefix = "request_#{Thread.current.object_id}_#{dataclass.to_s}_"
       dataclass.where(uuid: uuids).each do |obj|
         @objects_for[obj.uuid] = obj
+        if dataclass == Collection
+          # The collecions#index defaults to "all attributes except manifest_text"
+          # Hence, this object is not suitable for preloading the find() cache.
+        else
+          Rails.cache.write(key_prefix + obj.uuid, obj.as_json)
+        end
       end
     end
     @objects_for