Skip to content

Commit

Permalink
Caching & perf tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pcantrell committed Mar 23, 2017
1 parent 8a4067a commit 2a7f66b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def index
else
@event = Event.current_event
end
@sessions = @event.sessions.order('created_at desc')
@sessions = @event.sessions.includes(:presenters).order('created_at desc')
respond_with @sessions do |format|
format.json {
render json: SessionsJsonBuilder.new.to_json(@sessions.distinct)
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/pages/_sessions.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# Note that fragment contains user-specific info, must be cached per user %>
<%= cache [Session.maximum(:updated_at), current_participant], expires_in: 20.seconds do %>
<%= cache [Event.current_event.sessions, current_participant], expires_in: 5.minutes do %>

<h2>A Sampling of Sessions</h2>
<ul class="sessionsList">
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/schedules/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- cache [@event.sessions.maximum(:updated_at), @event.timeslots.maximum(:updated_at)] do
- cache [@event.sessions, @event.timeslots] do
= render 'header'
.schedule
.schedule-header
Expand Down

0 comments on commit 2a7f66b

Please sign in to comment.