diff --git a/app/controllers/v0/devices_controller.rb b/app/controllers/v0/devices_controller.rb index a7a67ee1..22d67e9a 100644 --- a/app/controllers/v0/devices_controller.rb +++ b/app/controllers/v0/devices_controller.rb @@ -75,8 +75,6 @@ def destroy # debug method, must be refactored def fresh_world_map - @no_cache = true - render :world_map end def world_map diff --git a/app/views/v0/devices/_world_map_list.jbuilder b/app/views/v0/devices/_world_map_list.jbuilder new file mode 100644 index 00000000..28c642db --- /dev/null +++ b/app/views/v0/devices/_world_map_list.jbuilder @@ -0,0 +1 @@ +json.array! Device.for_world_map, partial: 'device', as: :device, local_assigns: { with_data: false, with_postprocessing: false, slim_owner: true, never_authorized: true } \ No newline at end of file diff --git a/app/views/v0/devices/fresh_world_map.jbuilder b/app/views/v0/devices/fresh_world_map.jbuilder new file mode 100644 index 00000000..021cc4c5 --- /dev/null +++ b/app/views/v0/devices/fresh_world_map.jbuilder @@ -0,0 +1 @@ +json.partial! 'devices/world_map_list' \ No newline at end of file diff --git a/app/views/v0/devices/world_map.jbuilder b/app/views/v0/devices/world_map.jbuilder index 4c94ea3f..ac9a2abd 100644 --- a/app/views/v0/devices/world_map.jbuilder +++ b/app/views/v0/devices/world_map.jbuilder @@ -1,3 +1,3 @@ -json.cache_if! !@no_cache, ["world_map"], expires_in: 1.minute do - json.array! Device.for_world_map, partial: 'device', as: :device, local_assigns: { with_data: false, with_postprocessing: false, slim_owner: true, never_authorized: true } +json.cache! ["world_map"], expires_in: 1.minute do + json.partial! 'devices/world_map_list' end \ No newline at end of file