aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/public
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-03-13 22:04:00 +0100
committerKristian Lyngstol <kristian@bohemians.org>2016-03-13 22:04:00 +0100
commita57fe6b9a707222e0ca1b4e18a542b5b179e6b72 (patch)
treed342d858c8e142dafb76bb5d326ec1ebb3e040b3 /web/nms.gathering.org/api/public
parent8a89ee32f56e37848ad29be033b095c46b7ce9e3 (diff)
parentfe776bbc6f2e62436acea72f2f3bf027a6138ed8 (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/api/public')
-rwxr-xr-xweb/nms.gathering.org/api/public/ping2
-rwxr-xr-xweb/nms.gathering.org/api/public/switch-state2
-rwxr-xr-xweb/nms.gathering.org/api/public/switches2
3 files changed, 5 insertions, 1 deletions
diff --git a/web/nms.gathering.org/api/public/ping b/web/nms.gathering.org/api/public/ping
index f713df1..f13a03b 100755
--- a/web/nms.gathering.org/api/public/ping
+++ b/web/nms.gathering.org/api/public/ping
@@ -22,4 +22,6 @@ while (my $ref = $lq->fetchrow_hashref()) {
$q->execute();
+$nms::web::cc{'max-age'} = "1";
+$nms::web::cc{'stale-while-revalidate'} = "5";
finalize_output();
diff --git a/web/nms.gathering.org/api/public/switch-state b/web/nms.gathering.org/api/public/switch-state
index e494e6d..999a1d8 100755
--- a/web/nms.gathering.org/api/public/switch-state
+++ b/web/nms.gathering.org/api/public/switch-state
@@ -41,4 +41,6 @@ while (my $ref = $qs->fetchrow_hashref()) {
$nms::web::json{'switches'}{$ref->{'switch'}}{'latency_secondary'} = $ref->{'latency_ms'};
}
+$nms::web::cc{'max-age'} = "5";
+$nms::web::cc{'stale-while-revalidate'} = "30";
finalize_output();
diff --git a/web/nms.gathering.org/api/public/switches b/web/nms.gathering.org/api/public/switches
index d62169c..8447b2b 100755
--- a/web/nms.gathering.org/api/public/switches
+++ b/web/nms.gathering.org/api/public/switches
@@ -12,7 +12,7 @@ use Data::Dumper;
$nms::web::cc{'max-age'} = "60";
-my $q2 = $nms::web::dbh->prepare('select switch,sysname,placement,ip,switchtype,poll_frequency,community,last_updated from switches');
+my $q2 = $nms::web::dbh->prepare('select switch,sysname,placement,ip,switchtype,poll_frequency,community,last_updated from switches where placement is not null');
$q2->execute();
while (my $ref = $q2->fetchrow_hashref()) {