Last active
December 11, 2015 06:18
-
-
Save skaji/4558174 to your computer and use it in GitHub Desktop.
static ファイルをキャッシュさせない
This file contains 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 Mojolicious::Lite; | |
get '/' => sub { | |
my $self = shift; | |
$self->render_static('image.png'); | |
}; | |
hook before_routes => sub { | |
my $c = shift; | |
$c->req->headers->if_modified_since( | |
'Thu, 01 Jun 1970 00:00:00 GMT' | |
); | |
}; | |
app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment