]> ruin.nu Git - ndwebbie.git/commitdiff
Tweaked the cache and added a cleaning script
authorMichael Andreen <harv@ruin.nu>
Sun, 16 Nov 2008 14:43:13 +0000 (15:43 +0100)
committerMichael Andreen <harv@ruin.nu>
Sun, 16 Nov 2008 14:43:13 +0000 (15:43 +0100)
lib/NDWeb.pm
scripts/clean_cache.pl [new file with mode: 0755]

index d7aec9695d2374bb9310aa1f3c1d38aaff1bb333..8d90ff45e167c51719f9fe06d21b309178822d65 100644 (file)
@@ -38,12 +38,15 @@ __PACKAGE__->config( cache => {
        backend => {
                class => "Cache::FileCache",
                cache_root => "/tmp/ndweb-$>",
+               namespace => "cache",
+               default_expires_in => 3600,
                directory_umask => 077,
        },
 });
 
 __PACKAGE__->config( page_cache => {
        set_http_headers => 1,
+       disable_index => 1,
 });
 
 
diff --git a/scripts/clean_cache.pl b/scripts/clean_cache.pl
new file mode 100755 (executable)
index 0000000..313bbe5
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+use Cache::FileCache;
+
+my $cache = new Cache::FileCache({cache_root => "/tmp/ndweb-$<", namespace => 'cache'} );
+
+$cache->purge;
+