Update: Cached Job Index Data

Take advantage of repository monitor for change notification; in-memory
cache rather than retrieving data on each request.
This commit is contained in:
Gary Sharp
2013-04-30 12:42:59 +10:00
parent a6cfd5a63a
commit 32336af075
6 changed files with 152 additions and 79 deletions
+5 -7
View File
@@ -12,9 +12,11 @@
<h2>Daily Opened &amp; Closed Jobs</h2>
<div id="chartHostJobDailyOpenedClosed" style="height: 175px;">
</div>
@{
var jsonData = new HtmlString(Json.Encode(Model.DailyOpenedClosedStatistics));
}
<script type="text/javascript">
(function () {
var chartData;
function buildChart() {
@@ -105,12 +107,8 @@
});
});
}
$.getJSON('@(Url.Action(MVC.API.Job.StatisticsDailyOpenedClosed()))', function (data) {
chartData = data;
buildChart();
});
chartData = $.parseJSON('@(jsonData)');
buildChart();
}());
</script>