Skip to content

Commit

Permalink
world map caching properly this time?
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Feb 28, 2024
1 parent f7443cc commit 821eaaa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions app/controllers/v0/devices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/views/v0/devices/_world_map_list.jbuilder
Original file line number Diff line number Diff line change
@@ -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 }
1 change: 1 addition & 0 deletions app/views/v0/devices/fresh_world_map.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
json.partial! 'devices/world_map_list'
4 changes: 2 additions & 2 deletions app/views/v0/devices/world_map.jbuilder
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 821eaaa

Please sign in to comment.