+ if (not defined $timestamp or not $timestamp) {
+ $timestamp = (stat($cache_location))[9];
+ }
+ }
+ if (not defined $timestamp) {
+ # this probably means that the default image doesn't exist
+ print $q->header(status => 404);
+ print "404: Not found\n";
+ return;
+ }
+ my $etag = md5_hex($cache_location.$timestamp);
+ if (defined $q->http('if-none-match')
+ and $etag eq $q->http('if-none-match')) {
+ print $q->header(-status => 304);
+ print "304: Not modified\n";
+ return;