File: CacheTest.pm

package info (click to toggle)
libapache-filter-perl 1.022-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 244 kB
  • ctags: 66
  • sloc: perl: 901; makefile: 42
file content (25 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package Apache::CacheTest;

# This tests the 'deterministic' method

use strict;
use Apache::Constants qw(:common);


sub handler {
  my $r = shift->filter_register;
  
  $r->content_type("text/html");
  my ($fh, $status) = $r->filter_input();
  return $status unless $status == OK;
  
  if ($r->changed_since(time)) {
    print "Changed since right now\n";
  } else {
    print "Hasn't changed since right now\n";
  }
  
  return OK;
}
1;