aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/public
diff options
context:
space:
mode:
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()) {