mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-15 09:46:25 +00:00
Page caching set up
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -45,6 +45,7 @@ gem 'spring', :group => :development
|
||||
gem 'passenger'
|
||||
gem 'therubyracer'
|
||||
gem 'newrelic_rpm'
|
||||
gem 'dalli'
|
||||
end
|
||||
#Other
|
||||
gem 'devise'
|
||||
|
||||
@@ -48,6 +48,7 @@ GEM
|
||||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
concurrent-ruby (1.0.0)
|
||||
dalli (2.7.5)
|
||||
devise (3.4.1)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
@@ -160,6 +161,7 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
cancancan
|
||||
coffee-rails (~> 4.0.0)
|
||||
dalli
|
||||
devise
|
||||
jbuilder (~> 2.0)
|
||||
jquery-rails
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Match < ActiveRecord::Base
|
||||
belongs_to :tournament
|
||||
belongs_to :weight
|
||||
belongs_to :mat
|
||||
belongs_to :tournament, touch: true
|
||||
belongs_to :weight, touch: true
|
||||
belongs_to :mat, touch: true
|
||||
has_many :wrestlers, :through => :weight
|
||||
|
||||
after_save do
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
</br>
|
||||
</br>
|
||||
</br>
|
||||
<% cache ["brackets", @weight] do %>
|
||||
</br>
|
||||
</br>
|
||||
</br>
|
||||
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<h1><%= @weight.max %> lbs Bracket</h1>
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<h1><%= @weight.max %> lbs Bracket</h1>
|
||||
|
||||
<%= render 'pool' %>
|
||||
<%= render 'pool' %>
|
||||
|
||||
<% if @bracketType == "twoPoolsToFinal" %>
|
||||
<% if @bracketType == "twoPoolsToFinal" %>
|
||||
<%= render 'twoPoolFinalBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "twoPoolsToSemi" %>
|
||||
<% end %>
|
||||
<% if @bracketType == "twoPoolsToSemi" %>
|
||||
<%= render 'twoPoolSemiBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToQuarter" %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToSemi" %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToSemi" %>
|
||||
<%= render 'fourPoolSemiBracket' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,21 +1,22 @@
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default"%>
|
||||
<script>
|
||||
<% cache ["up_matches", @tournament] do %>
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default"%>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#matchList').dataTable();
|
||||
} );
|
||||
</script>
|
||||
<script>
|
||||
</script>
|
||||
<script>
|
||||
setTimeout("location.reload(true);",30000);
|
||||
</script>
|
||||
<br>
|
||||
<br>
|
||||
<h5 style="color:red">This page reloads every 30s</h5>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Upcoming Matches</h3>
|
||||
<br>
|
||||
<br>
|
||||
<table class="table table-striped table-bordered">
|
||||
</script>
|
||||
<br>
|
||||
<br>
|
||||
<h5 style="color:red">This page reloads every 30s</h5>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Upcoming Matches</h3>
|
||||
<br>
|
||||
<br>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mat</th>
|
||||
@@ -37,13 +38,13 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Matches not assigned</h3>
|
||||
<br>
|
||||
<br>
|
||||
<table class="display compact cell-border" id="matchList">
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Matches not assigned</h3>
|
||||
<br>
|
||||
<br>
|
||||
<table class="display compact cell-border" id="matchList">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Round</th>
|
||||
@@ -65,6 +66,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
@@ -54,6 +54,14 @@ Wrestling::Application.configure do
|
||||
|
||||
# Use a different cache store in production.
|
||||
# config.cache_store = :mem_cache_store
|
||||
config.cache_store = :dalli_store,
|
||||
(ENV["MEMCACHIER_SERVERS"] || "").split(","),
|
||||
{:username => ENV["MEMCACHIER_USERNAME"],
|
||||
:password => ENV["MEMCACHIER_PASSWORD"],
|
||||
:failover => true,
|
||||
:socket_timeout => 1.5,
|
||||
:socket_failure_delay => 0.2
|
||||
}
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
Reference in New Issue
Block a user