Created
November 22, 2015 12:21
-
-
Save babo/05695b6d7175d78a1fe6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Redis; | |
use CGI; | |
my $cgi = new CGI; | |
my $vars = $cgi->Vars; | |
my ($type,$nr) = ($vars->{type},$vars->{id}); | |
if ($nr > 0 && $type) { | |
$redis_srv = $ENV{'REDIS_SERVER'} || 'perftest.tnebn2.0001.use1.cache.amazonaws.com:6379'; | |
$r = Redis->new(server => $redis_srv); | |
$key = "counters/$type/$nr"; | |
$val = $r->incr($key); | |
print "Content-type: text/html\nCache-Control: max-age=0; must-revalidate\n\ntype=$type, nr = $nr, val = $val"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment