The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

assets-versionize.pl - Utility to add version to js, css and image file name

VERSION

version 0.1

SYNOPSIS

assets-versionize.pl [--dry-run --quiet] --assets-dir assets-dir --prefix prefix file-or-dir

      -n/--dry-run    print the lines to add version, but do not execute replacement
      -q/--quiet      do not print the lines to add version
      -s/--strict     strict regexp to match file. The file should match \.v[0-9a-f]{6}\.
      -a/--assets-dir assets directory 
      -p/--prefix     the prefix of the js, css and images file name in code

DESCRIPTION

You can add following code to your nginx configuration:

    location ~ "\.v[0-9a-f]{6}\.(js|css|png|jpg|jpeg|gif|ico)$" {
        rewrite "^(.*)\.v[0-9a-f]{6}\.(js|css|png|jpg|jpeg|gif|ico)$" $1.$2 last;
    }

    location ~ \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }

AUTHOR

Ye Wenbin, <wenbinye@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2013 by Ye Wenbin

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

BUGS

None reported... yet.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 71:

Non-ASCII character seen before =encoding in 'configuration:'. Assuming UTF-8